Last active
February 28, 2021 10:31
-
-
Save andreyshedko/1214847cc2c7a02fa207e577b95e93f1 to your computer and use it in GitHub Desktop.
Reverse 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
// Решение 1 | |
function reverse(string) { | |
return string.split('').reverse().join(''); | |
} | |
for (let character of string) { | |
reversed = character + reversed; | |
} | |
return reversed; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment