Node: Inheritance

Using the events and util classes in the core Node library, we can define inheritance:

var Events = require(‘events’);

var util = require(‘util’);

function hello() {

this.greeting = “Hi!”;

}

util.inherits(hello, Events);

 

Node: Inheritance
User Rating: 0 (0 votes)