Codington
0 of 10 problems solved • 0%
Use in a course

Exercise prompt

Number a Packing List

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.

Example

const colors = ["red", "blue"]; for (let index = 0; index < colors.length; index += 1) { console.log(colors[index]); }

Your task

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.

Hint

The array index and the number shown to a person start at different values.