Skip to content

Instantly share code, notes, and snippets.

@mbrown3321
Created October 17, 2020 18:00
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 mbrown3321/f275f32a7f9fe27b054956ce09499be6 to your computer and use it in GitHub Desktop.
Save mbrown3321/f275f32a7f9fe27b054956ce09499be6 to your computer and use it in GitHub Desktop.
let results = []
for (let i = 0; i < users.length; i++) {
if (users[i].active && users[i].loginCount > 50) {
results.push(users[i]);
}
}
// [
// {
// "id": 2,
// "name": "Dwight Schrute",
// "loginCount": 776655,
// "active": true
// },
// {
// "id": 3,
// "name": "Jim Halpert",
// "loginCount": 75,
// "active": true
// }
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment