for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

Quildreen Motta quildreen at gmail.com
Tue Nov 8 14:09:46 PST 2011


On 08/11/11 19:19, Axel Rauschmayer wrote:
> I see two domains for the concept of “own” properties:
> 1. Meta-programming.
Could you expand on the use of `own' properties for meta-programming? 
I'm afraid I can't really envision it =/

> 2. Using objects as dictionaries.
>
> Isn’t #2 the majority (at least as far as non-library-programmers are 
> concerned)? Will the concept become less relevant once we have David 
> Herman’s dicts?
I would think most of the cases where objects are used as dicts would be 
solved by using `Object.create(null)', today on ES5-compliant engines. 
Except for the nasty, nasty `__proto__' on engines that use that magic, 
but then you can proxy property access/assignment. It's quite ad-hoc, 
but works.

The dicts proposal looks nice though.




More information about the es-discuss mailing list