1var myArr = [{id:'a'},{id:'myid'},{id:'c'}];
2var index = arr.findIndex(function(o){
3 return o.id === 'myid';
4})
5if (index !== -1) myArr.splice(index, 1);
1const drinks = ['Cola', 'Lemonade', 'Coffee', 'Water'];
2const id = 2;
3const removedDrink = drinks.splice(id, 1);