> Exactly what I was looking for. Thanks.
>
> Not exactly...
True. But it's OK for me as a work-around.
> That should be
>
> while (!{}.hasOwnProperty.call(obj, key))
>
> which works even if obj has an own property named 'hasOwnProperty'.
IIRC, {} creates a new instance for each invocation. Thus, a better solution
would be
while (!Object.prototype.hasOwnProperty.call(obj, key))
But I usually prefer David’s more readable version and take the risk of a name
clash.
--
Dr. Axel Rauschmayer
[email protected]
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss