Created
September 12, 2018 12:16
-
-
Save ristaa/f0240953a28248799f70ecc089a18a10 to your computer and use it in GitHub Desktop.
Filter Helper
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
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