following adds items to array:
var arrayOptions = []; function AddToFilterOptionList(mode) { arrayOptions.push(mode); }
remove item fr
let items = [1, 2, 3, 2, 4, 5, 2, 7]; let item = 2; for (let i = 0; i < items.length; i++) { if (items[i] === item) { items.splice(i, 1); i = i - 1; } }
If you want to remove the element '2' from items array, it is a way.