Skip to content

Instantly share code, notes, and snippets.

@qodirovshohijahon
Last active January 11, 2020 13:55
Show Gist options
  • Save qodirovshohijahon/6a1146abee5f85a3cd0aeaf13ea8331d to your computer and use it in GitHub Desktop.
Save qodirovshohijahon/6a1146abee5f85a3cd0aeaf13ea8331d to your computer and use it in GitHub Desktop.
In this example you can see one of the common way to reverse array elements using for loop.
function reversedString (mystr) {
let str = "";
for(let i = mystr.length; i > 0; i--){
str += i;
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment