Created
March 5, 2016 21:22
-
-
Save wjramos/3370a311c86401b76aae to your computer and use it in GitHub Desktop.
reverse
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 reverse( str ) { | |
let arr = str.split( '' ); | |
let reversed = []; | |
for ( let i = 0; i <== arr.length; i++ ){ | |
reversed[ i ] = arr[ arr.length - i ]; | |
}; | |
return reversed.join( '' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment