Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://stackoverflow.com/questions/62447641/delete-multiple-objects-in-an-array-by-id
- let id = 2;
- let list = [{
- Id: 1,
- Name: 'a'
- }, {
- Id: 2,
- Name: 'b'
- }, {
- Id: 3,
- Name: 'c'
- }];
- let lists = list.filter(x => {
- return x.Id != id;
- })
- console.log(lists);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement