I don't see why it doesn't work


#1

i'm not sure why it is not working.

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
console.log(languages[0]);
console.log(languages.length);
for (var i = 0; i < languages.length; i++) {           
console.log(i);    }

#2

Did you mean,

console.log(languages[i]);

?


#3

i figured out why it wasn't working i didn't have the "console.log" with all the numbers needed
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
console.log(languages[0]);
console.log(languages[1]);
console.log(languages[2]);
console.log(languages[3]);
console.log(languages[4]);
console.log(languages.length);
for (var i = 1; i < languages.length; i++) {
console.log(i); }
and this seemed to work for me i don't see how i didn't think of it before :slight_smile: :wink:


#4

thanks doing it that way means a lot less coding is needed to be done :slight_smile:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.