Last active
January 11, 2020 13:55
-
-
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.
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
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