Re: Small Proposal "!in"

2018-06-28 Thread Guylian Cox
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 a écrit : > On Thu, Jun 28, 2018 at 5:14 PM, Tobias

Re: Small Proposal "!in"

2018-06-28 Thread T.J. Crowder
On Thu, Jun 28, 2018 at 5:14 PM, Tobias Buschor 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

Small Proposal "!in"

2018-06-28 Thread Tobias Buschor
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() } What about a !in operator to write it like this? if ('x' !in obj && 'y' !in obj) { doit() }

Re: [Proposal] New syntax for lazy getters

2018-06-28 Thread Augusto Moura
*An errata in my code* The getter is mutating the object with a enumerable property, so consecutives invocations of JSON.stringify will result different from the first call (if the property is yet not initialized). The current problem is: ```js JSON.stringify(foo) // Returns "{"bar":3}" // After