Hacker News new | ask | show | jobs
by CrossEye 4179 days ago
I think the concern is simple, really.

People are going to be told (rightly so) to use `let` instead of `var`. If they do so too mechanically, and their code is structured in certain ways, an expression which could never before throw an exception in Javascript, `typeof x`, now will do so.

This is not the end of the world, by any means. And it doesn't add an exception into unchanged code, but it still is a legitimate concern.

1 comments

In pretty much every case, if changing 'var' to 'let' would trigger this issue, the original code isn't doing what the author thought it was.