使用
Array.filter()方法:
myArray = myArray.filter( function( el ) { return toRemove.indexOf( el ) < 0;} );小改进,因为对浏览器的支持
Array.includes()增加了:
myArray = myArray.filter( function( el ) { return !toRemove.includes( el );} );使用arrow functions:下一个适应:
myArray = myArray.filter( ( el ) => !toRemove.includes( el ) );



