Seu laço for deve se parecer com isso: for (var i = 0; i < languages.length; i++) { // console.log o 'i'-esimo elemento // do array languages }


#1

Vá em frente e use um laço for para enviar cada elemento do array languages para o console.
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
{
for (var i = 0; i < languages.length; i++);
console.log 'i';

};


#2

In your browser, you can use the console.log() method to display data. Syntax:

var data = "some data"
console.log(data); // outputting of variable 
console.log('some data'); // outputting of string

In your case should be:

console.log(languages[i]);

where

languages[0] -> "HTML"
languages[1] -> "CSS"
...
languages[4] -> "Ruby"

#3

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