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('');
console.log(splits);
var reversed = splits.reverse();
console.log(reversed);
console.log(reversed.join(''));
return str;
}
reverseString("hello");
Your browser information:
User Agent is: Mozilla/5.0 (Windows Home 10.0; Win64; x64) Chrome/75.0.3770.80
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/reverse-a-string