JS macierzy mapy mapy pomijają element
let newArray = oldArray.map(function (item) {
if(<conditon for exclusion>)
return false; // This will skip current element
else
// logic for mapping acceptable elements
});
Alert Aardvark