Created
January 15, 2019 13:52
-
-
Save mfrachet/dee0704d606fcc975da9f3184a8ee711 to your computer and use it in GitHub Desktop.
array-apis.js
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
const isEven = x => x % 2 === 0; | |
const double = x => x * 2; | |
const array = [1, 2, 3, 4, 5]; | |
const evenNumber = array.filter(isEven); | |
const doubleEven = evenNumber.map(double); // doubleEven is [4, 8] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment