while we're busting popular JS myths... "let doesn't hoist". False. var x = 2; { console.log(x); let x = 3; } That code throws a TDZ error because the `x` in `let x` was in fact hoisted to the { } scope; it's just uninitialized. If no hoisting, would print `2`.
-
-
Can you file a bug? I'll make the change
-
It sounded like
@getify already did (https://twitter.com/getify/status/1101858448482787328 …) but I couldn’t find it… So filed https://bugs.chromium.org/p/v8/issues/detail?id=8938 …. - 2 more replies
New conversation -
-
-
I agree it's a good TDZ error message. Been hoping/advocating for browsers to adopt something like that for quite awhile.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.