Created
April 6, 2017 04:11
-
-
Save grantsheppard/273b16742e75f82a10a4363c94918eb7 to your computer and use it in GitHub Desktop.
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
const imperativeDouble = numbers => { | |
const doubled = [] | |
for (i = 0; i < numbers.length; i++) { | |
doubled.push(numbers[i] * 2) | |
} | |
return doubled; | |
} | |
const declarativeDouble = numbers => numbers.map(n => n * 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment