-
-
Save IrhaAli/d2fb6316353f21fe22a9f8a78281ac6f to your computer and use it in GitHub Desktop.
Reverses the string
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
const reverse = function(string) { | |
let reverseString = ''; | |
for (let i = string.length - 1; i >= 0; i--) { | |
reverseString += string[i]; | |
} | |
return reverseString; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment