Skip to content

Instantly share code, notes, and snippets.

@mvasilkov
Created January 14, 2013 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvasilkov/4528738 to your computer and use it in GitHub Desktop.
Save mvasilkov/4528738 to your computer and use it in GitHub Desktop.
var obj = function() {}
obj.prototype.f = function(name) { if (this[name] === void 0) this[name] = new obj; return this[name] }
obj.prototype.get = function(name) { return this[name] }
obj.prototype.set = function(name, value) { this[name] = value }
// Usage:
var x = new obj
x.f("file").f("document").f("properties").set("т прнс?", true)
x.f("file").f("document").f("properties").get("т прнс?")
// -> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment