'void' as a value
waldron.rick at gmail.com
Mon Sep 9 10:41:13 PDT 2013
On Mon, Sep 9, 2013 at 5:41 AM, Claude Pache <claude.pache at gmail.com> wrote:
> Le 9 sept. 2013 à 10:35, David Bruant <bruant.d at gmail.com> a écrit :
> > Le 08/09/2013 21:39, Brendan Eich a écrit :
> >> In no case does anyone that I've spoken to, on TC39 or anywhere else
> around this planet, want *yet another* bottom type and singleton value a la
> null and undefined. No one. Those who speak Spanish and nearby languages
> tend to say "¡Basta!" -- I'm not kidding :-|.
> > Two values are already arguably (!) a regrettable feature
> > David
> For me, it is a excellent feature, if we get the correct semantic:
> * `undefined` means "no value", or "nothing";
> * `null` means "empty value", or (well) "null".
This was exactly my response, and I'll add that the only regrettable aspect
is the typeof null issue.
> Practical usefulness:
> * ES5: JSON stringification of object: `null` means `null`, and
> `undefined` means "no value, don't include the corresponding key".
> * ES6: default values in function arguments (and maybe destructuring
> assignment?): `null` means `null`, and `undefined` means "no value, take
> the default".
Yep. I think that in the world of ES6 we'll see developers learning and
respecting the difference between null and undefined.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss