Small Proposal "!in"

Guylian Cox guyliancox at gmail.com
Thu Jun 28 16:31:17 UTC 2018


I agree, it's very annoying to have to write it !(x in y). I've been
wanting this operator for a very, very long time.

If there is interest for !in, I think !instanceof deserves to be included
too.

Le jeu. 28 juin 2018 à 18:19, T.J. Crowder <tj.crowder at farsightsoftware.com>
a écrit :

> On Thu, Jun 28, 2018 at 5:14 PM, Tobias Buschor <tobias.buschor at shwups.ch>
> wrote:
> > I dont like to write:
> > if ( !('x' in obj) &&  !('y' in obj) ) {
> >      doit()
> > }
> >
> > I was even tempted to write it that way:
> > if ('x' in obj  ||  'y' in obj) { } else {
> >      doit()
> > }
>
> There's
>
> ```js
> if (!('x' in obj  ||  'y' in obj)) {
>      doit()
> }
> ```
>
> That said, I've wanted !in many a time, in a minor sort of way...
>
> -- T.J. Crowder
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180628/0d5efba0/attachment.html>


More information about the es-discuss mailing list