Hacker News new | ask | show | jobs
by hasenj 4181 days 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?

1 comments

No, 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.
If a statement didn't throw before and might start throwing now, that would be a problem for existing code wouldn't it?
No 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.