Answers for "javascript remove all the common value from array"

0

javascript remove all the common value from array

toRemove =[1,2];
myArray = [1,2,3,5];

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

Code answers related to "javascript remove all the common value from array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language