Skip to content

Instantly share code, notes, and snippets.

@hebertcisco
Created May 23, 2020 05:34
Show Gist options
  • Save hebertcisco/8f5b56823e6049a88994cbe78710bc1b to your computer and use it in GitHub Desktop.
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.
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