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
Code the first line of a method, calcTotal(), inside a constructor. | this.calcTotal = function() { | this\.calcTotal=function\(\){ | |
Code the first line of a method, calcTotal(), in a prototype. The constructor's name is Order. | Order.prototype.calcTotal = function() { | Order\.prototype\.calcTotal=function\(\){ | |
Code the first line of a method, showName(), inside a constructor. | this.showName = function() { | this\.showName=function\(\){ | |
Code the first line of a method, showName() in a prototype. The constructor's name is Patient. | Patient.prototype.showName = function() { | Patient\.prototype\.showName=function\(\){ | |
Code the first line of a statement that creates a single copy of a method for all objects created by a constructor. Make up the names. | Planet.prototype.calcDensity = function() { | [A-Z][a-zA-Z0-9_$]*\.prototype\.[a-z_$][a-zA-Z0-9_$]*=function\(\){ | |
Code the first line of a statement that creates a single copy of a string property for all objects created by a constructor. Make up everything. | Primate.prototype.stance = "upright"; | [A-Z][a-zA-Z0-9_$]*\.prototype\.[a-z_$][a-zA-Z0-9_$]*=•.*•; | |
Code a statement that creates a single copy of an integer property for all objects created by a constructor. Make up everything. | Primate.prototype.arms = 2; | [A-Z][a-zA-Z0-9_$]*\.prototype\.[a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*); | |
Code a statement that overrides a prototype's integer property value. Make up everything. | starfish.arms = 5; | [a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*=(0|-?[1-9][\d]*); | |
|
|||
|