Answers for "array remove elements not in other 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 "array remove elements not in other array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language