function pull(array,...values){ let len = array.length >>> 0; while(len-- > 0){ if(values.indexOf(array[len]) !== -1){ array.splice(len,1) } } } var array = [1, 2, 3, 1, 2, 3,4]; pull(array, 2, 3); console.log(array)