Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
} );
 
PREVIOUS NEXT
Tagged: #javascript #remove #common #array
ADD COMMENT
Topic
Name
1+4 =