array of objects typescript delete code example
Example 1: typescript remove object from array
const index = myArray.indexOf(key, 0);
if (index > -1) {
myArray.splice(index, 1);
}
Example 2: remove object from array by name javascript
var id = 88;
for(var i = 0; i < data.length; i++) {
if(data[i].id == id) {
data.splice(i, 1);
break;
}
}