Which code segment should you use?

You are creating a JavaScript object that represents a customer.
You need to extend the Customer object by adding the GetCommission() method.
You need to ensure that all future instancesof the Customer object implement the GetCommission() method.
Which code segment should you use?

You are creating a JavaScript object that represents a customer.
You need to extend the Customer object by adding the GetCommission() method.
You need to ensure that all future instancesof the Customer object implement the GetCommission() method.
Which code segment should you use?

A.

B.

C.

D.

Explanation:
Prototype
A prototype is an object from which other objects inherit properties
function.apply()
Calls a function with a given thisvalue and argumentsprovided as an array



Leave a Reply 0

Your email address will not be published. Required fields are marked *