The simplest solution is:
array - array for remove some element valueForRemove;
valueForRemove - element for remove;
array.filter(arrayItem => !array.includes(valueForRemove));
More simple:
array.filter(arrayItem => arrayItem !== valueForRemove);
No pretty, but works:
array.filter(arrayItem => array.indexOf(arrayItem) != array.indexOf(valueForRemove))
No pretty, but works:
while(array.indexOf(valueForRemove) !== -1) {
array.splice(array.indexOf(valueForRemove), 1)
}
P.S. The filter() method creates a new array with all elements that pass the test implemented by the provided function. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter