Created
September 4, 2016 20:22
-
-
Save jgresalfi/7226ee44651b8582bc5ac595f764a3d9 to your computer and use it in GitHub Desktop.
Reversing strings
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) { | |
var strArray = str.split(""); | |
strArray.reverse(""); | |
return strArray.join(""); | |
} | |
reverseString("hello"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment