JavaScript Forum - Thread 5

Hi everyone, I'm having trouble with a simple JavaScript function. I'm trying to reverse a string, but it's not working as expected.


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

console.log(reverseString("hello"));

That's a good starting point! You can also use recursion, although it might be a bit more complex for this simple task.