4 ms·
That works in Python, because Python has a distinction between an "instance" object, and, say, a Dict. In JavaScript an object is an object is an object -- unde
by jashkenas 15y ago
That works in Python, because Python has a distinction between an "instance" object, and, say, a Dict. In JavaScript an object is an object is an object -- under your proposed change, what would be the value of "this, in this:
Klass.prototype.method = options.method;
- masklinn 15y ago> That works in Python, because Python has a distinction between an "instance" object, and, say, a Dict. Not really, it's trivial to create a dict-like object which allows access to keys as properties, just override `__getattr__`. > In JavaScript an object is an object is an object No, objects can have a non-null [[prototype]] indicating it was created from using `new` on a constructor. > Klass.prototype.method = options.method; Depends what `options` is.