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 | |
|---|---|---|
| 1nums.push(4) | Anums.unshift(1) | |
| 2nums.pop() | Bnums.shift() | |
| 3Adds an element to the start of an array | CAdds 4 to the end of the nums array | |
| 4Removes the first element from an array | DWrong - use pop(), not remove(), to remove the last element | |
| 5a.add(3); | EWrong - use push(), not add(), to add to the end | |
| 6b.remove(); | FRemoves the last element from the nums array |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
push() — Adds one or more elements to the end of an array, changing the original array.nums.push(4);nums.pop();nums.unshift(1);let first = nums.shift();scores.push(90);