3 ms·
nit: You never declare hoisted at all. Wouldn’t that assignment cause globalThis.hoisted = "foo" ? I assume you meant to declare it somehow, but it will only wo
by jchw 5y ago
nit: You never declare hoisted at all. Wouldn’t that assignment cause globalThis.hoisted = "foo" ? I assume you meant to declare it somehow, but it will only work if you declare it with var, which isn’t block-scoped to begin with.
- dvt 5y agoTotally correct, fixed now! I omitted the var by design since I was just trying to elucidate the difference between hoisted and err (the var keyword breaks that flow a bit).