I'm working on an assignment that experiments with different types of loops. I have to use a for loop to console.log each item in the array cars. I can only use a for loop, no other methods such as for each. What am I missing?
I have tried console logging cars but that logs the entire array a number of times equal to the number of strings in the array, which is obviously not correct. I'm also fairly certain that the .length method used in the for loop is incorrect as well.
const cars = ["ford", "chevrolet", "dodge", "mazda", "fiat"];
for (let i = 0; i < cars.length; i++) {
console.log(cars)
}