remove objects from array code example
Example 1: remove a particular element from array
var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");
colors.splice(carIndex, 1);
Example 2: js remove object from array by value
let originalArray = [
{name: 'John', age: 23, color: 'red'},
{name: 'Ann', age: 21, color: 'blue'},
{name: 'Mike', age: 13, color: 'green'}
];
let filteredArray = originalArray.filter(value => value.age > 18);
Example 3: remove object from array javascript
someArray.splice(x, 1);
Example 4: javascript remove object from array
var array = ['Object1', 'Object2'];
array.pop(object);
array.shift(object);
array.splice(position, 1);