// remove 5
let arr = [1,2,3,4,5,6];
let remove = arr.filter((id) => id !== 5)
console.log(remove) // [1,2,3,4,6]
const index = array.indexOf(item);
if (index !== -1) array.splice(index, 1);
var index = array.indexOf(item);
if (index !== -1) array.splice(index, 1);
var arr = ['bill', 'is', 'not', 'lame'];
arr.splice(output_items.indexOf('not'), 1);
console.log(arr) //returns ['bill', 'is', 'lame']
var index = array.indexOf(item);
if (index !== -1) {
array.splice(index, 1);
}
Array.prototype.spliceAll = function (criteria) {
return this.filter(e=>e !== criteria) }
let newArray = myArray.spliceAll('removeThisString')
/*//*\_AS A PROTOTYPE METHOD |OR| AS AN ARROW FUNCTION_/|**/
const spliceAll = (a,c) => a.filter(e=>e !== c)
let newArray = spliceAll(myArray, 'removeThisString')