can array map skip items conditionally code example
Example: js array map skip element
let newArray = oldArray.map(function (item) {
if(<conditon for exclusion>)
return false; // This will skip current element
else
// logic for mapping acceptable elements
});