An indexed loop can visit every array position. The counter is used as the index, and the array's length decides when the loop stops.
const colors = ["red", "blue"];
for (let index = 0; index < colors.length; index += 1) {
console.log(colors[index]);
}Display the supplied packing list as 1. charger, 2. notebook, and 3. bottle. Use the loop index both to read each item and create its visible number.
The array index and the number shown to a person start at different values.