Code Studio · Level 6
Array Builder
Students add values to an array and use a loop to print each item.
Loop through a list.
Example code
let badges = ["helper", "debugger", "builder"];
for (let i = 0; i < badges.length; i++) {
say("Badge " + (i + 1) + ": " + badges[i]);
}
Program result
- Run your code to see output.
Type real JavaScript, then run it.
Array builder complete.
You used an array with a loop so the computer could visit each item in order.
Try Array Challenge