I tried:
var reverseString = function(str) {
var myArray = str;
var reversed = myArray.reverse();
return reversed;
};
reverseString("hello");
and
function reverseString(str) {
var myArray = str;
var reversed = myArray.reverse();
return reversed;
}
reverseString("hello");
The result is the same: “myArray.reverse isn’t a function”.
I searched on Google and I know we can put two vars in the same function and I also checked on developer.mozilla.org the “var reversed” is correct.
Link to the challenge: