Tell us what’s happening:
however my code is not complete
but why isn’t this way of converting string into array wont work?
Your code so far
function reverseString(str) {
let arr=[];
for (let i=0;i<str.length;i++){
arr[i]=str[str.length-i];
console.log(arr[i]);
}
return str;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
.
Link to the challenge: