Universal inheritance function

An example showing how tocreate universal inheritance function using Tizen 2.3.
function inherits(Child, Parent) {
  Child.prototype = Object.create(Parent.prototype);
  Child.prototype.constructor = Child;
};

// Usage

var Child = function() {
  Parent.apply(this, arguments);
};

var Parent = function() {
};

inherits(Child, Parent);

// Defining child only prototype properties.
Child.prototype.customProperty = function() {};

Responses

0 Replies