The story for JS is

undefined is "no value"
null is "no object"

It's definitely a just-so story, and some listeners want their money back, but we're stuck with two. For defaulting, undefined is the only choice of an in-language sentinel you can express. No one wants to add yet another bottom type and singleton value.

/be

Domenic Denicola wrote:
I'm sympathetic toward `undefined` as a sentinel for "no value of the expected type," 
whereas `null` means "we have a value of the expected type, but that value represents 
'nothing.'" Not sure if anyone else sees it that way, though, and admittedly it's based on 
vague hand-wavey arguments.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to