Used the split, reverse and join methods. Here’s my solution.
function reverseString(str) {
let splitStr = str.split("");
let reverseString = splitStr.reverse("");
let joinStr = reverseString.join("");
return joinStr;
}
reverseString("hello");
function reverseString(str) {
return str.split("").reverse().join("");
}
reverseString("hello");