delete item from array of objects javascript - Google Search

PHOTO EMBED

Tue Jan 31 2023 15:35:39 GMT+0000 (Coordinated Universal Time)

Saved by @piyushkacha #javascript

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)
 Run code snippet
content_copyCOPY

https://www.google.com/search?q