LS JS Object Prototypes

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

There is a prototype property, caseQty, for the constructor Product. Its value is 12. Make an exception for product332. Its caseQty is 6.

product332.caseQty = 6;

This is the first line of a prototype statement that creates a prototype method for the constructor MakeObj. Fill in the blank. MakeObj.________.calcTax = function(price) {

prototype

What is the keyword that allows all objects created by a particular constructor to share the same property or function?

prototype

Code a method prototype that displays a message. The message text is *passed to the method by the constructor*, not the statement that calls the method.

MakeObj.prototype.dispMess = function() { alert(this.message); };

Code a method prototype that displays a message. The message text is *passed to the method by the statement* that calls the method, not by the constructor.

MakeObj.prototype.dispMess = function(message) { alert(message); };

Code a method prototype that has no parameters and does nothing.

MakeObj.prototype.doNothing = function() { };

Code a prototype property called *brand* for a constructor called *Part*. Its value is "Acme"

Part.prototype.brand = "Acme";

This is the first line of a prototype statement that creates a prototype method for the constructor *Product*. Fill in the blank. ______.prototype.selectPkg = function(dimensions, weight) {

Product

Code a statement that creates a prototype number property.

Product.prototype.caseQty = 12;

Code the first line of a prototype method called *calcTime* for a constructor called *Recipe*

Recipe.prototype.calcTime = function() {

This is the first line of a prototype statement that creates a prototype method for the constructor Product. The method has no parameters. Fill in the blank. Product.prototype.totalCosts = _____________

function() {


Ensembles d'études connexes

Principles of Computing Chapter 2

View Set

Nursing Final multiple choice (chapter 72, 73, 74)

View Set

List of the President of the Philippines

View Set

Blockchain and Digital Asset Terminology

View Set

Family Health Exam II (with sherpath)

View Set