1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
Assign the integer 0 to the height property of the object whose identifier is line. | line.height = 0; | line\.height=0; | |
Get the value of the volume property of the object tank and assign it to the variable vol, which hasn't been declared beforehand. | let vol = tank.volume; | letvol=tank\.volume | |
Get the value of the golfHandicap property of the object frankenstein and assign it to the variable hCap, which hasn't been defined beforehand. | let hCap = frankenstein.golfHandicap; | lethCap=frankenstein\.golfHandicap; | |
Declare the name property of the object newSpecies, assigning it no value. | newSpecies.name = ""; | newSpecies\.name=••; | |
Assign a Boolean value to an object's property. Make up the object identifier and property name and choose the Boolean. | candidate.pledge = false; | [a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*=(true|false); | |
Display the value of an object's property in an alert. Make up everything. | alert(mexico.area); | alert\([a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*\); | |
Remove an object's property. Make up everything. | delete judgeSmithfield.nickname; | delete[a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*; | |
Code the first line of an if statement that checks whether an object has a particular property. Make up everything. | if ("wins" in sanMarino) { | if\(•[a-z_$][a-zA-Z0-9_$]*•in[a-z_$][a-zA-Z0-9_$]*\){ | |
|
|||
|