repl.it
@themaka/

Array Filter

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const avengers = [
  { name: "Iron Man", realName: "Tony Stark", sID: false },
  { name: "Captain America", realName: "Steve Rogers", sID: false },
  { name: "Black Widow", realName: "Natasha Romanov", sID: true },
  { name: "Vision", realName: "Vision", sID: false },
  { name: "Thor", realName: "Thor", sID: false },
  { name: "Hulk", realName: "Bruce Banner" , sID: true},
  { name: "Hawkeye", realName: "Clint Barton", sID: true}
]

const checkPublic = avengers.filter(avenger => 
  avenger.sID==false)

console.log(checkPublic)
Fetching token
?