Skip to content

Instantly share code, notes, and snippets.

View kodunmi's full-sized avatar


View GitHub Profile
kodunmi / splice-object-array.js
Created July 9, 2020 14:08 — forked from scottopolis/splice-object-array.js
Remove object from array of objects in Javascript
// source:
// we have an array of objects, we want to remove one object using only the id property
var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}];
// get index of object with id:37
var removeIndex = { return; }).indexOf(37);
// remove object
apps.splice(removeIndex, 1);