Skip to content

Instantly share code, notes, and snippets.

@BolajiOlajide
Created May 10, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BolajiOlajide/28dba962b47d81682b73c4ff1d04bf96 to your computer and use it in GitHub Desktop.
Save BolajiOlajide/28dba962b47d81682b73c4ff1d04bf96 to your computer and use it in GitHub Desktop.
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