const apps = [
{id:1, name:'Jon'},
{id:2, name:'Dave'},
{id:3, name:'Joe'}
]
//remove item with id=2
const itemToBeRemoved = {id:2, name:'Dave'}
apps.splice(apps.findIndex(a => a.id === itemToBeRemoved.id) , 1)
//print result
console.log(apps)
const fruits = [
{id:1, name: 'Banana'},
{id:2, name: 'Apple'},
{id:3, name: 'Kiwi'}
]
// Remove Apple with id '2'
const newFruits = fruits.filter(fruit => fruit.id !== 'Apple')
console.log(newFruits)
// [
// {id:1, name: 'Banana'},
// {id:3, name: 'Kiwi'}
// ]