Skip to content

Instantly share code, notes, and snippets.

View Moncader's full-sized avatar

Jason Parrott Moncader

  • GREE Inc.
  • Chiba Japan
  • 13:47 (UTC +09:00)
View GitHub Profile
(function(global) {
global.TreeNode = TreeNode;
/**
* @constructor
*/
function TreeNode() {
/** @type {Array.<TreeNode>} */
this.childNodes = [];
@Moncader
Moncader / gist:3521832
Created August 30, 2012 02:38
JS Class Style Inheriting
function inherit(pThis, pBase) {
pThis.prototype = Object.create(pBase.prototype);
pThis.prototype.constructor = pThis;
pThis.prototype.super = pBase.prototype;
}
function Animal() {
this.type = 'animal';
this.num = 34;
}