2 ms·
Sure, but then you have to create a function for each property, even if it's a number or a string. Those bytes add up significantly in large applications. Addi
by tomdale 15y ago
Sure, but then you have to create a function for each property, even if it's a number or a string. Those bytes add up significantly in large applications.
Additionally, specifying the property as a string allows you to implement "unknown property" handlers, which is another extremely powerful idiom.
- mbostock 15y agoThis might become more common when Proxy is supported more widely in JavaScript implementations. http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxie...