Archived
What does the following code display?
const travel = ["guadeloupe", "brazil", "suriname"];
let airplane = 1;
for (var i =0; i <voyage.length; i++)
{
airplane ++;
}
console.log(i);
-4
Community Evaluations
Carlos
19/06/2022
the voyage array isn't define in this script, so the script through an error. I put nothing and i get an incorrect answer, its weird...
Auteur anonyme
18/07/2022
Thanks for your feedback. I think my collegue fixed the question without answering you. The snippet has been fixed and displays the right answer now.
Auteur anonyme
18/07/2022
Hi, it's still not fixed on my end. I selected "nothing" and it still says that it's an error
Auteur anonyme
16/08/2022
Bonnjour. J'ai eut ça qui s'est affiché à l'écran: const travel = ["guadeloupe", "brazil", "suriname"]; let airplane = 1; for (var i =0; i <voyage.length; i++) {airplane ++;} console.log(i); // On voit bien ici que la variable dans la boucle for est 'voyage'. Cette derniÚre n'étant pas défini, ça retroune une erreur. La bonne réponse n'étant pas proposé j'ai opté pour "nothing". Qui s'est avéré fausse. J'en conclu que la bonne était "3". Le bug de traduction n'a pas été corrigé
Similar QuestionsMore questions about Javascript
61
Understanding the differences between `map()` and `forEach()` methods in JavaScript28
Write a JavaScript function that fetches data from an API and logs it to the console.19
Fix the following Javascript loop:10
The certificate variable is not attainable outside the if loop9
Use spread operator to split an array into two arrays in Javascript