Created
May 11, 2019 12:48
-
-
Save stevencch99/8e7d99f18d32a9515b6e8cc69335ccfa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Example in JavaScript | |
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
function isEven(x){ | |
return x % 2 === 0; | |
} | |
let evenNumbers = numbers.filter(isEven); | |
// 2 4 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment