Last active
June 21, 2016 13:54
-
-
Save brainyfarm/bedf69e67f6008cab4a198cd29c0d6ed to your computer and use it in GitHub Desktop.
Olawale/FreeCodeCamp Algorithm: Reverse a String
This file contains hidden or 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) { | |
// Split into an array, reverse, join and return the reversed string | |
return str.split('').reverse().join(''); | |
} | |
reverseString("hello"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment