remove item object in array javascript code example
Example 1: how to find and remove object from array in javascript
var id = 88;
for(var i = 0; i < data.length; i++) {
if(data[i].id == id) {
data.splice(i, 1);
break;
}
}
Example 2: how to remove an object from an array javascript
someArray.splice(x, 1);// if you want to remove element at position x