Created
January 1, 2017 20:34
-
-
Save mannuelf/1174b4f319b5335231171bfe31da95fe to your computer and use it in GitHub Desktop.
Handling Permissions with Filter
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
const users = [ | |
{ id: 1, admin: true }, | |
{ id: 2, admin: false }, | |
{ id: 3, admin: false }, | |
{ id: 4, admin: false }, | |
{ id: 5, admin: true }, | |
]; | |
let filteredUsers = users.filter(function(user) { | |
return user.admin === true; | |
}); | |
console.log(filteredUsers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment