0

How do you reverse a string in place in JavaScript?

JavaScript
function reverse(s){
    return s.split("").reverse().join("");
}

console.log(reverse("this is example text")); // "txet elpmaxe si siht"
RUN
add comment
Suggest a different solution or add another example