+ 2
Reversing a String in JavaScript
How would one reverse a String in JavaScript?
1 Answer
+ 5
var string = âyourStringâ;
var stringArray = string.split(ââ);
stringArray.reverse();
string = stringArray.join(ââ);
Or to shorten it
string = string.split(ââ).reverse().join(ââ);