Need help with basic algorithm

Need help with basic algorithm
0

#1

Help, guys! I wrote a perfectly working code, even checked in other users profiles that this should work, but it doesn’t. It’s sort of website error. Checked other profiles - can’t build this code either.
Would you kindly help me, because i can’t head up to the next task before finishing that one (when, I can, technically but don’t want to leave unfinished tasks).

Screen Shot 2018-01-22 at 01.24.28


#2

The test works for me. But there are some problems in your code.

  1. You are supposed to reverse the string inside the function and then return that value from the function. I think that that is what the test looks for when testing your code. It is testing your function, not what is outside your function.

  2. I’m not sure what reverseString = $('hello'); is trying to do. Usually, the $ refers to jQuery which is not an issue here. You are overriding the definition of the function and assigning it something - I don’t know what. Completely remove line 6.

  3. The logic in line 7 is basically correct, just in the wrong place. It should be inside the function and return that value. When I put that logic inside the function, it passes for me.


#3

The reversed string needs to be the returned value of the function reverseString. Your function just returns the original string.