Last active
November 17, 2021 22:36
-
-
Save pedroglcbarros/e74c5aee546f164fb6e70d77cbffc445 to your computer and use it in GitHub Desktop.
String Inversion Algorithm
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
| function invertString (str) { | |
| invertedString = []; | |
| for (let i = str.length - 1; i >= 0; i--) { | |
| invertedString.push(str[i]) | |
| } | |
| return invertedString.join("") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment