Basic Algorithm Scripting - Reverse a String

need help

function reverseString(str) {
  let str = "olleh"
  return str;
}

reverseString("hello");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.44

Challenge: Basic Algorithm Scripting - Reverse a String

Link to the challenge:

This would only work if str was the word hello.

You need to think about the algorithm you would need to implement in order to reverse any string passed to the function. If you did it manually with pen and paper, how would you approach the task?