Skip to content

Instantly share code, notes, and snippets.

@pedroglcbarros
Last active November 17, 2021 22:36
Show Gist options
  • Select an option

  • Save pedroglcbarros/e74c5aee546f164fb6e70d77cbffc445 to your computer and use it in GitHub Desktop.

Select an option

Save pedroglcbarros/e74c5aee546f164fb6e70d77cbffc445 to your computer and use it in GitHub Desktop.
String Inversion Algorithm
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