+ 2
How to reverse a string in js
Can I know How to reverse a string in js
3 Answers
0
You can create an array from the string, reverse the array, join all the elements by a blank space, finally convert it into a new string.
source = "Hello world";
reversed = Array.from(source).reverse().join("").toString();
console.log(reversed);
0
Thanks for answering my question