Re: Object Model Reformation – elementIn?
Axel Rauschmayer
axel at rauschma.de
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 rauschma.de
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120102/86a06196/attachment.html>
More information about the es-discuss
mailing list