Skip to content

Instantly share code, notes, and snippets.

@ristaa ristaa/filter.js
Created Sep 12, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.