Skip to content

Instantly share code, notes, and snippets.

@mbrown3321
Created October 17, 2020 18:42
Show Gist options
  • Save mbrown3321/af9beccacb283bbb850a6515b87c3ec2 to your computer and use it in GitHub Desktop.
Save mbrown3321/af9beccacb283bbb850a6515b87c3ec2 to your computer and use it in GitHub Desktop.
let result1 = users.find(u => u.active);
// {id: 2, name: "Dwight Schrute", loginCount: 776655, active: true}
let result2 = users.find(u => u.id === 5);
// {id: 5, name: "Darryl Philbin", loginCount: 33, active: true}
let result3 = users.find(u => u.name.startsWith('Ryan'));
// {id: 4, name: "Ryan Howard", loginCount: 2, active: false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment