Skip to content

Instantly share code, notes, and snippets.

@diasraphael
Created July 20, 2021 08:02
Show Gist options
  • Save diasraphael/09986cdff78f5245d103a9bd4188b6bd to your computer and use it in GitHub Desktop.
Save diasraphael/09986cdff78f5245d103a9bd4188b6bd to your computer and use it in GitHub Desktop.
function reverseString(str){
let reverse = "";
for (let a = str.length - 1; a >= 0; a--){
reverse = reverse + str[a];
}
return reverse;
}
console.log(reverseString("World"));
console.log(reverseString(""))
console.log(reverseString("T"))
console.log(reverseString("raw"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment