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: Prototype Inheritance

Function construction in Node is pretty straight forward: function someFunction(){ console.log(“hi”); } Functions can also be assigned to an object like so: var greeting = function someFunction(){ console.log(“hi”); } You can also follow a class type pattern doing something such as: function Car(make, model, year){ this.make = make; this.model = Continue Reading