Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Created November 2, 2009 08:40
Show Gist options
  • Save oberhamsi/224033 to your computer and use it in GitHub Desktop.
Save oberhamsi/224033 to your computer and use it in GitHub Desktop.
var Config = function(){};
Config.prototype.a = 100;
Config.prototype.b = 200;
var Flags = function() {};
Flags.prototype = new Config();
Flags.constructor = Flags;
Flags.prototype.a = 3;
Flags.prototype.c = 5;
var options = new Flags();
js> options.a
3
js> options.b
200
js> options.c
5
js> options instanceof Flags
true
js> options instanceof Config
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment