Answers for "remove items from an array using 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
1

remove item from array if exists in another array

myArray = myArray.filter( function( el ) {
  return toRemove.indexOf( el ) < 0;
} );
Posted by: Guest on September-30-2021

Code answers related to "remove items from an array using another array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language