Last active
August 28, 2018 04:16
-
-
Save lienista/c7a271e038a3d0c252133a58e3247e08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const recursiveReverseString = (originalString) => { | |
| let reversedString = ''; | |
| let formReverseString = (word) => { | |
| if(word.length > 0) { | |
| reversedString = formReverseString(word.substr(1)) + word.charAt(0); | |
| return reversedString; | |
| } | |
| return ''; | |
| } | |
| formReverseString(originalString); | |
| return reversedString; | |
| } | |
| recursiveReverseString('hello'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment