Day 2 meeting notes
douglas at crockford.com
Fri Jul 30 13:09:33 PDT 2010
On 11:59 AM, Oliver Hunt wrote:
> I keep seeing code like this, I simply don't see it as viable to have
> "for (.. in ...)" sometimes enumerate property names, and some times
> enumerate keys, it seems like it could be both confusing and error
> prone. esp. given the simplest example: [x for (value in [1,2,3])] you
> would not get the desired behaviour, unless in comprehensions for(in)
> behaves differently from everywhere else.
> It seems far better to just define a distinct syntax for enumerating values of an object.
I agree. We talked about swapping out the preposition, so for..in
produces keys, and for..of or for..from produces values.
More information about the es-discuss