delete array from obj js code example
Example: javascript remove object from array
const array = [
{ id: 1, name: 'serdar' },
{ id: 5, name: 'alex' },
{ id: 300, name: 'brittany' }
];
const idToRemove = 5;
const filterArray = array.filter((item) => item.id !== idToRemove); //ES6
// [
// { id: 1, name: 'serdar' },
// { id: 300, name: 'brittany' }
// [