js remove element from array using element code example
Example 1: javascript remove from array by index
//Remove specific value by index
array.splice(index, 1);
Example 2: delete from array based on value javascript
var index = array.indexOf(item);
if (index !== -1) array.splice(index, 1);