Simple


#1

I had to view the 3rd element of an array and i did in 2 ways, but one if them is incorrect:
1st way:

var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
console.log(languages[2]);
languages[2];

and it prints to the console: JavaScript
"JavaScript"

2nd way:

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

and it prints out "JavaScript" to the console.

so can somebody explain me why it is not acceptable to view only as an array?

thank you in advance!!


#2


console.log
is used to get the output of a statement.

Whereas just writing a statement makes the interpreter automatically put the raw value to the console.


#3

thank you! now i got it how it understands :smile:


#4

You're welcome. :slight_smile:


#5

Plz de l'aide je n'arrive pas a validé

11.Itérer sur des tableaux:

langages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]


#6

There are separate language categories for you to get more responses from. #fr


#7

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