1var arr= [{id: "123", name: "Faa"},
2 {id: "123", name: "Bar"},
3 {id: "345", name: "Foo"},
4 {id: "678", name: "FaaBar"}
5 ];
6
7var name = 'FaaBar';
8var id = '678';
9
10arr = arr.filter(function(elem) {
11 //return false for the element that matches both the name and the id
12 return !(elem.id == id && elem.name == name)
13});
1const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
2
3const filter = arr.filter((number) => number > 5);
4console.log(filter); // [6, 7, 8, 9]
5
1var arr= [{id: "123", name: "Foo"},
2 {id: "123", name: "Bar"},
3 {id: "345", name: "Foo"},
4 {id: "678", name: "FooBar"}
5 ];
6
7var name = 'Foo';
8var id = '123';
9
10arr = arr.filter(function(elem) {
11 //return false for the element that matches both the name and the id
12 return !(elem.id == id && elem.name == name)
13});
14