If you would like to look up the answers for the following quiz questions, you can check our discussion forum. If you don't find an answer in the forum, you may create a post asking for an answer to a particular question.
Which code fragment is correctly defining the constructor-based inheritance pattern where the subclass B
inherits from the superclass A
?
Select one:
O
function A(a) { this.a = a; } function B(a,b) { A(a); this.b = b; } B.prototype = Object.create( A.prototype); B.prototype.constructor = B;
O
function A(a) { this.a = a; } function B(a,b) { A.call( this, a); this.b = b; } A.prototype = Object.create( B.prototype); B.prototype.constructor = B;
O
function A(a) { this.a = a; } function B(a,b) { this.a = a; this.b = b; } B.prototype = Object.create( A.prototype); B.prototype.constructor = B;
O
function A(a) { this.a = a; } function B(a,b) { A.call( this, a); this.b = b; } B.prototype = Object.create( A.prototype); B.prototype.constructor = B;
Recall that in a class resulting from applying the Class Hierarchy Merge design pattern, we have segment properties corresponding to the properties of the merged segment classes (subclasses).
How many parameters does the check method for a segment property have?
Answer: ________