Skip to content

Instantly share code, notes, and snippets.

@heryvandoro
Created October 2, 2018 12:33
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 heryvandoro/3af02d492ae34f77ecd45d99233a4db9 to your computer and use it in GitHub Desktop.
Save heryvandoro/3af02d492ae34f77ecd45d99233a4db9 to your computer and use it in GitHub Desktop.
let products = [
{ name: "Apple", type: "fruit" },
{ name: "Monitor", type: "computer" },
{ name: "Mango", type: "fruit" },
{ name: "Table", type: "furniture" }
];
console.log(
products.every(product => product.type === "fruit") //false
);
console.log(
products.some(product => product.type === "fruit") //true
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment