Object.defineProperty(o, n, { get: function() { this[n] = {}; } }) this works in Firefox, and not in Chrome...
@csuwildcat yea, that works in both engines, but defineProperty is *SLOW*. Object creation gets faster, property access is far slower
-
-
@seanmonstar or do: return this.__props__[n] ? this.__props__[n] : this.__props__[n] = {}; Assuming you're not against creating a props obj. -
@seanmonstar more simply: return this.__props__[n] || this.__props__[n] = {}; - 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.