[Solved] Reverse the String in JavaScript [duplicate]
[ad_1] I call the split function passing dash which separate each part of the string str.split(“-“).reverse().join(“-“); Description of functions used String.prototype.split(): The split() method turns a String into an array of strings, by separating the string at each instance of a specified separator string. const chaine = “Text”; console.log(chaine.split(”)); // output [“T”, “e”, “x”, “t”] … Read more