Skip to content

Instantly share code, notes, and snippets.

@IrhaAli

IrhaAli/reverse Secret

Last active November 24, 2022 23:57
Show Gist options
  • Save IrhaAli/d2fb6316353f21fe22a9f8a78281ac6f to your computer and use it in GitHub Desktop.
Save IrhaAli/d2fb6316353f21fe22a9f8a78281ac6f to your computer and use it in GitHub Desktop.
Reverses the string
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