Skip to content

Instantly share code, notes, and snippets.

@sagi
Created December 18, 2018 10:03
Show Gist options
  • Save sagi/f382666f6d4b184839c69c2f8ad8f47f to your computer and use it in GitHub Desktop.
Save sagi/f382666f6d4b184839c69c2f8ad8f47f to your computer and use it in GitHub Desktop.
Reversing a String in Javascript
const reverse = s => (s === '' ? '' : reverse(s.substr(1)) + s.charAt(0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment