Skip to content

Instantly share code, notes, and snippets.

@NEbere
Created February 11, 2016 16:15
Show Gist options
  • Save NEbere/b823245fc054d99849f4 to your computer and use it in GitHub Desktop.
Save NEbere/b823245fc054d99849f4 to your computer and use it in GitHub Desktop.
Reverse a string in vanilla javascript
function reverseString(str) {
return str.split("").reverse().join("");
}
alert(reverseString("hello"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment