Created
March 8, 2016 17:19
-
-
Save base698/b8a7936f9935759e3659 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
function reverse(string) { | |
if(string.length == 1) { | |
return string; | |
} | |
return string.charAt(string.length - 1) + reverse(string.slice(0, string.length - 1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment