Simplemente revertir la cadena

function reverseString(str) {
    return str.split("").reverse().join("");
}
reverseString("hello");
Unsightly Unicorn