Created
September 6, 2019 03:52
-
-
Save masautt/bc26c58dfc81a60c39ba731943b66a13 to your computer and use it in GitHub Desktop.
How to reverse string in JavaScript?
This file contains hidden or 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
let str = "marek"; | |
console.log(str.split("").reverse().join("")); // --> "keram" | |
// Takes string, splits into char array, reverses array, then joins back to string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment