Created
September 5, 2017 15:08
-
-
Save mowamed/86cbf057e211290d006feb153cf0b319 to your computer and use it in GitHub Desktop.
reverse a string in javascript created by mowamed - https://repl.it/KiGR/0
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) { | |
arr = str.split(''); | |
newarr = arr.reverse(); | |
str = newarr.join(''); | |
return str; | |
} | |
reverseString("hello"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment