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 hero = [{'id' : 1, 'name' : 'hero1'}, {'id': 2, 'name' : 'hero2'}];
2//remove hero1
3const updatedHero = hero.filter(item => item.id !== 1);
4