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 | |
|---|---|---|
| 1return a + b; | AStores the value returned by add() in total | |
| 2let total = add(2, 3); | BWrong - 'return' must be lowercase | |
| 3Ends a function's execution and sends back a value | Creturn | |
| 4Sends back the square of a number | DSends the sum of a and b back out of the function | |
| 5Retrun a + b; | EWrong - 'return' is misspelled | |
| 6Return a - b; | Freturn n * n; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
return — Sends a value back out of a function and ends its execution at that point.return a + b;let total = add(2, 3);return x * y;function square(n) {
return n * n;
}let result = square(4);