Reverse a String - Can someone take a look


Can someone take a look at my code here, I am getting the proper output data type as well the string output is reversed but I am not getting my precious green check boxes.

Can someone take a look at the below and let me know what is the issue:

var string=[];
function reverseString(str) {
return String(string);


I think you’re making it a bit complex buddy.

Just make str equal to str split reversed and joined back together again. You can do it all on one line by method chaining. Check out my profile if you want. I always comment stuff so I remember how I did it. No need for the for loop at the beginning.

thats so complex for such a trivia task

var string= "hello";


haha thanks OMahonyD & zealsham! I may have overdone it there. Any clue why my way wouldn’t work? Or is this section meant to be done in as few lines as possible?

Oh god, that’s much better.
I did it the way OP did too.

1 Like

I figured since all the previous tasks were around arrays that was a good place to start, I had it doing what was recommended but over about 15 lines and console.log after each one.