Question from the Javascript - Fundamentals test

Print the number of countries in the array travel.

Medium

What does the following code display?

    const travel = ["guadeloupe", "brazil", "suriname"]; 
    let airplane = 1;
    for (var i =0; i <travel.length; i++) 
    {        
        airplane ++;
    }
    console.log(i);
Author: Vincent CotroStatus: Published(Update)Question passed 2194 times
Edit
4
Community Evaluations
developer avatar
Ludovic JIGAN
05/04/2024
Le scope Ă©tant global "i" est accessible en dehors de la boucle for