Need help with this code

I am only outputting the letter “o” but no error message. Need help please:

var str = “hello”;
function reverseString(str) {

str2 = str.split("").reverse("");

for (var i = 0; i < str2.length; i++){

return str2[i];
}
}

reverseString(“hello”);

First, move the str variable inside the function. Challenges don’t pass if you used global variables.

return stops the function it is in to return the value, even if it’s in the middle of a loop.

Rethink what you are returning and when to do it.

I moved the var declaration inside the function but still outputting “o.” I will appreciate just a clue where to place the “return” so it doesn’t stop at “o.”

Oh well, I am getting closer but still some issues. I able to reverse but I am getting ( “o l, l, e, h”). Also, I need to remove the commas:

function reverseString(str) {
var str2 = “hello”;
str2 = str.split("").reverse("").join();

for (var i = 0; i < str2.length; i++){

return str2;
}
}

reverseString(“hello”);

Sorry just solved it! I guess I am too impatient.