Created
March 21, 2017 19:47
-
-
Save joanllenas/e62ea30c0f6dbac0c1c774d3a1816488 to your computer and use it in GitHub Desktop.
Misc exercises
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
/** | |
* Reverse a list in one expression, without using Array.reverse() | |
*/ | |
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
.reduce( | |
(acc, val) => [val, ...acc], | |
[] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment