Basic Algorithm Scripting: Reverse a String - code check

Tell us what’s happening:
Why my code is not accepting?
I checked in Codepen console, all prints out correctly.

Your code so far

function reverseString(str) {
 var splits = str.split('');
  var reversed = splits.reverse();
  return str;


Your browser information:

User Agent is: Mozilla/5.0 (Windows Home 10.0; Win64; x64) Chrome/75.0.3770.80.

Link to the challenge:

Hi @crlybrcs!

I can’t see that you’re returning the new reversed string at the end of the function? I think you’re just returning the passed parameter str which is not what the test is expecting :slightly_smiling_face:.

1 Like