You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JS does variable hoisting, which means that B always exists throughout the function body but it may not have a value. Indeed, at the first line, B's value is undefined, which is falsy in JS, and leads to A being false.
We might fix this issue by generating code with a ton of nested closures, e.g.,
In this code, A is defined before B, but doesn't cause a ReferenceError:
And the resulting conditional distribution always has A = false, which is unintuitive.
The problem is that the JS we compile to looks like this:
JS does variable hoisting, which means that B always exists throughout the function body but it may not have a value. Indeed, at the first line, B's value is
undefined
, which is falsy in JS, and leads to A being false.We might fix this issue by generating code with a ton of nested closures, e.g.,
But this would likely degrade performance
The text was updated successfully, but these errors were encountered: