June 2014
Intermediate to advanced
696 pages
38h 52m
English
The util Module provides the util.inherits() method to allow you to create objects that inherit the prototype methods from another object. When you create a new object, the prototype methods are automatically used. You have already seen this in a few examples in this book—for example, when implementing your own custom Readable and Writable streams.
The following is the syntax of the util.inherits() method:
util.inherits(constructor, superConstructor)
The prototype constructor is set to the prototype superConstructor and is executed when a new object is created. You can access superConstructor from your custom object constructor by using that constructor.super_ property. ...
Read now
Unlock full access