You sure? I assume you are console logging, but sometimes that can be tricky with some minor errors. Highlight the text in the console and see if you can find the minor error.
Edit: something better to highlight it would be tossing strings around your variable "**"+variable+"**" in the log.
The problem is you are returning a new variable “result”, but the problem wants you to make the changes in str variable itself and then return str and not some local variable.