Created
February 11, 2016 16:15
-
-
Save NEbere/b823245fc054d99849f4 to your computer and use it in GitHub Desktop.
Reverse a string in vanilla javascript
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) { | |
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