I have the following JavaScript where I have some lists:
var deleteLinks = $(\".remove-button .remove-from-cart\"); deleteLinks.on(\'click\', function(ev){
If you have access to lodash, you can use _.difference to solve this in one line.
var a = ['a', 'b', 'c'], b = ['b'], result = []; _.difference(a, b).forEach(function(t) {result.push(a.indexOf(t))}); console.log(result);