Created
May 10, 2017 15:40
-
-
Save BolajiOlajide/28dba962b47d81682b73c4ff1d04bf96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human { | |
constructor(name, id){ | |
this.name = name; | |
this.id = id; | |
} | |
} | |
one = new Human('bolaji',1); | |
two = new Human('murphy', 1); | |
three = new Human('anu',3); | |
arr = [one, two, three]; | |
console.log(arr); | |
console.log(arr.filter((obj) => obj.id === 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment