remove only 1 instance of array javascfipt code example
Example 1: remove a specific element from an array
array.splice(array.indexOf(item), 1);
Example 2: js remove if
ar = [1, 2, 3, 4];
ar = ar.filter(item => !(item > 3));
console.log(ar) // [1, 2, 3]