Answers for "check and remove element if an array contains any element of another array"

1

remove item from array if exists in another array

myArray = myArray.filter( ( el ) => !toRemove.includes( el ) );
Posted by: Guest on September-30-2021
0

remove item from array if exists in another array

$filteredFoo = array_diff($foo, $bar);
Posted by: Guest on December-07-2020

Code answers related to "check and remove element if an array contains any element of another array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language