Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to link prototypes in js using call method

// Linking both
// ElectricCar.prototype is what you want to link
// Car.prototype is where you want to link the ElectricCar.prototype.

ElectricCar.prototype = Object.create(Car.prototype);
 
PREVIOUS NEXT
Tagged: #link #prototypes #js #call #method
ADD COMMENT
Topic
Name
9+5 =