Here is my JS fiddle: https://jsfiddle.net/apasric4/1e2uyorv/
This is the section of my code that's causing me issues:
const randomizeWord=(randomWord)=> {
let arr=randomWord.split("")
for (let i=arr.length<0; i>0;i--) {
let temp = arr[i];
let j = Math.floor(Math.random() * (i + 1));
arr[i] = arr[j];
arr[j] = temp;
}
console.log(arr)
}
I am following an instructional on creating a scrambling game. However for some reason, the array returned back to me is not scrambled properly. I don't get why that is? I seem to be doing that exact same thing as other coders are doing, but it's coming back to me the same way.
As you can see in the JS fiddle, its returning back undefined.
This is def a beginner question, but if someone could help I would really appreciate it.
Thanks