compare arrays
by dshilkret
JavaScript
// If I have this array:
var myArray = ['dog.pdf','cat.pdf', 'b', 'c', 'd', 'e', 'f', 'g'];
// and this one:
var toRemove = ['b', 'c', 'g','dog.pdf'];
function removeIt(arr1,arr2){
myArray = myArray.filter( ( el ) => !toRemove.includes( el ) );
console.log(myArray);
}
removeIt(myArray,toRemove);