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 | |
|---|---|---|
| 1constructor(name) { this.name = name; } | Aconstructor(name) { ... } | |
| 2new Dog("Rex") | BWrong - 'constructor' must be lowercase | |
| 3Refers to the new object being created inside a constructor | CRuns automatically when a new Dog is created, setting name | |
| 4Runs automatically whenever a class is instantiated with new | DCreates a new Dog instance and calls its constructor | |
| 5Constructor(name) { this.name = name; } | Ethis | |
| 6let d = New Dog(5); | FWrong - 'new' must be lowercase |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
constructor — A special method inside a class that runs automatically when a new instance is created.constructor(name) {this.name = name;let myDog = new Dog("Rex");constructor(color) {this.color = color;