Created
May 23, 2020 05:34
-
-
Save hebertcisco/8f5b56823e6049a88994cbe78710bc1b to your computer and use it in GitHub Desktop.
The some() method tests whether any of the elements in the array pass the test implemented by the assigned function.
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 age_user = [ | |
{ | |
name: "Jane Dow", | |
age: 39, | |
}, | |
{ | |
name: "John Doe", | |
age: 39, | |
}, | |
{ | |
name: "Rebecca Flex", | |
age: 16, | |
}, | |
]; | |
const authorized_user = (valueGet) => valueGet.age >= 18; | |
const adduct_only = age_user.some(authorized_user); | |
console.log(adduct_only); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment