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 | |
|---|---|---|
| 1class Dog { } | AThe new keyword is missing, so no object is made from the class. It should be new Dog("Rex"). | |
| 2let rex = new Dog("Rex"); | Bbark is a method of a dog object, not of the class blueprint. Make an object like rex first, then call rex.bark(). | |
| 3A property holds data about an object, like a noun (the dog's name) | CA blueprint that describes what every dog will have and do | |
| 4A method is an action an object can do, like a verb (bark) | Dconsole.log(rex.name); | |
| 5Dog.bark(); | Erex.bark(); | |
| 6let rex = Dog("Rex"); | FMakes one object, the dog Rex, from the Dog blueprint |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
class Dog — A blueprint for dogs. An object like Rex is made from it. Properties are its data (nouns like name) and methods are its actions (verbs like bark).class Dog {
bark() { console.log("Woof!"); }
}const rex = new Dog("Rex");const rex = new Dog("Rex");
console.log(rex.name);const rex = new Dog("Rex");
rex.bark();constructor(name) {
this.name = name;
}