Answers for "what filter method in js return"

2

the filter array

var id = 2;
var list = [{
  Id: 1,
  Name: 'a'
}, {
  Id: 2,
  Name: 'b'
}, {
  Id: 3,
  Name: 'c'
}];
var lists = list.filter(x => {
  return x.Id != id;
})
console.log(lists);
Posted by: Guest on May-07-2021
2

filter array in js

const rebels = pilots.filter(pilot => pilot.faction === "Rebels");
const empire = pilots.filter(pilot => pilot.faction === "Empire");
Posted by: Guest on June-10-2021

Code answers related to "what filter method in js return"

Code answers related to "Javascript"

Browse Popular Code Answers by Language