Nick Krempel wrote:
I should also say that I agree with you that it is unfortunate that if getFoo() is a function returning either a number or undefined (say), you can't use the proposed if(let) syntax to distinguish undefined.

Then you would have to write it out the long way, and use a block around the if to narrow the scope. No shorthand proposal can satisfy all use-cases, but I think it would be a mistake to add if(let) and not test truthiness.

Of course, we may not agree to add such a truthy-testing if(let). But let's have Arv's strawman fiirst!

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to