Created
January 11, 2020 13:56
-
-
Save qodirovshohijahon/9d57af7460497d22c2d9f6b8e2244cc8 to your computer and use it in GitHub Desktop.
In this example you can see one of unique way to reverse array elements using recursive functions
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 reverseString (str) { | |
if(str === "") return ""; else | |
return reverseString(str.substr(1)) + str.charAt(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment