javascript remove all the common value from array code example
Example: 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;
} );
toRemove =[1,2];
myArray = [1,2,3,5];
myArray = myArray.filter( function( el ) {
return toRemove.indexOf( el ) < 0;
} );