Created
May 23, 2020 05:24
-
-
Save hebertcisco/2e448b0d3a85fcd8e15c7d3ab5a28a27 to your computer and use it in GitHub Desktop.
Say if all users are authorized using age as a parameter:
This file contains hidden or 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 ageUser = [ | |
{ | |
name: "Jane Dow", | |
age: 39, | |
}, | |
{ | |
name: "John Doe", | |
age: 39, | |
}, | |
{ | |
name: "Rebecca Flex", | |
age: 16, | |
}, | |
]; | |
const authorizedUser = (valueGet) => valueGet.age >= 18; | |
const adductOnly = ageUser.every(authorizedUser); | |
console.log(adductOnly); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment