Re: Object Model Reformation – elementIn?

Axel Rauschmayer axel at
Mon Jan 2 09:45:10 PST 2012

>> Currently, there one can override the built-in operators via elementGet (getting via []), elementSet (setting via []) and elementDelete (`delete` operator). Wouldn’t it make sense to also provide elementIn (`in` operator)?
> Probably.  It may depend upon how strongly you feel about obsoleting for-in in favor of for-of.

That would be some kind of iteration protocol(?) I’d be perfectly happy with not supporting for-in at all.

I was thinking about the relational operator `in`:

    if (key in myMap) {

    if (element in mySet) {

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list