typeof null

Brendan Eich brendan at mozilla.com
Thu Aug 29 12:40:32 PDT 2013


Nathan Wall wrote:
> Alex Rauschmayer wrote:
>> Quick, possibly silly idea: What if `typeof null` returned `undefined`?
>
>
> By default or after you flip a switch? 		 	   		

I have a better value objects draft coming, which addresses opt-in 
typeof reform (cross-realm!).

In the mean time, typeof null == "object" and anything else will break 
the web. Doesn't matter whether "null" or "undefined" -- too much code 
requires typeof null == "object". Someone from the V8 team should weigh 
in with the bug link(s).

/be


More information about the es-discuss mailing list