Created
January 25, 2018 06:32
-
-
Save dragonza/058776df99202e5ee413f56424232657 to your computer and use it in GitHub Desktop.
String reversal with for ... of
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 reverseString = ''; | |
for (let character of str) { | |
reverseString = character + reverseString; | |
} | |
return reverseString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment