4. Iterating over an arrays



Could you please explain to me, why I can't do this in the way stated below? I know the correct answer, this is just the first idea I've came up with and I still cannot understand why it is not working.

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];

for (languages.length = 0; languages.length <=4; languages.length += 1)


because you set the length of languages to zero? In essence making the array empty:

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
languages.length = 0


Thank you kindly. It now seems obvious...