Skip to content

Instantly share code, notes, and snippets.

@ristaa
Created September 12, 2018 12:16
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 ristaa/f0240953a28248799f70ecc089a18a10 to your computer and use it in GitHub Desktop.
Save ristaa/f0240953a28248799f70ecc089a18a10 to your computer and use it in GitHub Desktop.
Filter Helper
let baskets = [12, 5, 8, 130, 44];
function moreThanTenApples(element) {
return (element >= 10);
}
let passed = baskets.filter(moreThanTenApples);
console.log("Those baskets have more than 10 apples: " + passed ); // "Those baskets have more than 10 apples: 12, 130, 44"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment