Skip to content

Instantly share code, notes, and snippets.

@souparno
souparno / Combination Constructor & Prototype Pattern
Last active January 4, 2016 11:19 — forked from zacksleo/JavaScript Class
Combination Constructor & Prototype Pattern
/**
* Combination Constructor/Prototype Pattern
*/
//constructor
function Something(name){
//properties
this.name = name;
}
//prototype
@souparno
souparno / Javascript Inheritence
Last active January 3, 2016 23:49
A number of references on the javascript Class Framework/Class Implementation
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};