Skip to content

Instantly share code, notes, and snippets.

@joanllenas
Created March 21, 2017 19:47
Show Gist options
  • Save joanllenas/e62ea30c0f6dbac0c1c774d3a1816488 to your computer and use it in GitHub Desktop.
Save joanllenas/e62ea30c0f6dbac0c1c774d3a1816488 to your computer and use it in GitHub Desktop.
Misc exercises
/**
* 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