Skip to content

Instantly share code, notes, and snippets.

@harmenjanssen
Last active August 20, 2017 11:57
Show Gist options
  • Select an option

  • Save harmenjanssen/b91c394dd26a06c5192e68e5be321da8 to your computer and use it in GitHub Desktop.

Select an option

Save harmenjanssen/b91c394dd26a06c5192e68e5be321da8 to your computer and use it in GitHub Desktop.
Recursive reverse function.
const reverse = ([head, ...rest]) =>
!head ? [] : reverse([...rest]).concat([head]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment