remove element of array with index js code example
Example 1: js remove item from array by value
var arr = ['bill', 'is', 'not', 'lame'];
arr.splice(output_items.indexOf('not'), 1);
console.log(arr) //returns ['bill', 'is', 'lame']
Example 2: remove array elements javascript
let forDeletion = [2, 3, 5]
let arr = [1, 2, 3, 4, 5, 3]
arr = arr.filter(item => !forDeletion.includes(item))
// !!! Read below about array.includes(...) support !!!
console.log(arr)
// [ 1, 4 ]