Skip to content

Instantly share code, notes, and snippets.

@andreyshedko
Last active February 28, 2021 10:31
Show Gist options
  • Save andreyshedko/1214847cc2c7a02fa207e577b95e93f1 to your computer and use it in GitHub Desktop.
Save andreyshedko/1214847cc2c7a02fa207e577b95e93f1 to your computer and use it in GitHub Desktop.
Reverse string
// Решение 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