Created
July 17, 2018 13:03
-
-
Save adamgiese/284b7d1f14a63c70e82e592c869feb2e to your computer and use it in GitHub Desktop.
Declarative Arrays: Square map
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 numbers = [1,2,3,4,5]; | |
const squares = numbers.map(currentValue => currentValue * currentValue); | |
console.log(squares); // [1,4,9,16,25]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment