Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1["apple", "banana", "cherry"] | AWrong - arrays use square brackets, not round brackets | |
| 2fruits[0] | Bcolors[1] | |
| 3Accesses the second element of an array | CWrong - index access uses square brackets, not round brackets | |
| 4The starting index for the first element in an array | DCreates an array holding three string values | |
| 5let a = (1, 2, 3); | EAccesses the first element of the fruits array | |
| 6console.log(fruits(0)); | F0 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
[] — Creates an array and, when placed after a variable name, accesses an element by its index.let fruits = ["apple", "banana"];console.log(fruits[0]);let colors = ["red", "blue"];
console.log(colors[1]);let nums = [1, 2, 3];
console.log(nums[0]);let sizes = [10, 20, 30];
console.log(sizes[2]);