|
|
|
|
|
by belandrew
4390 days ago
|
|
> Python is more dynamic than JavaScript, in that it has __getattr__, __setattr__, __getitem__, etc. No, it's not. You can do equivalents to all of those in Javascript. Javascript objects are all mutable with a few exceptions. They are just maps of properties, very similar to Python's. Properties can be added or changed at runtime. For example, setattr(obj, item, value) in python is basically just obj[item] = value in js. |
|
JavaScript is in the process of getting similar capabilities with Harmony proxies, but the spec has yet to be finalized: http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxie...