2 ms·
`typeof a` right now returns the string value "undefined" (assuming `a` was not defined anywhere) If it can either return "undefined" or throw an exception, ca
by hasenj 12y ago
`typeof a` right now returns the string value "undefined" (assuming `a` was not defined anywhere)
If it can either return "undefined" or throw an exception, can you see why that would be a problem?
- arcatek 12y agoNo, because it can only throw if there's a flaw in the code. Not randomly according to the argument passed to the function. Unless I'm missing something, it will either always throw, or never throw.
- svisser 12y agoIf a statement didn't throw before and might start throwing now, that would be a problem for existing code wouldn't it?
- baudehlo 12y agoNo because the let keyword didn't exist before. So existing code won't suddenly start to throw. The article's author is making a terrible, bogus argument.