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
The statement var something = something; works even as the first statement in its scope, because it is equivalent to
varsomething;something=something;
and it, as imagined, sets something to undefined, even if something was already defined in an outer scope.
To make a local reference to an object in an outer scope with the same name, it needs to be passed in as a function parameter, because otherwise, the inner name will shadow the outer name because of hoisting.
The text was updated successfully, but these errors were encountered:
The statement
var something = something;
works even as the first statement in its scope, because it is equivalent toand it, as imagined, sets
something
toundefined
, even ifsomething
was already defined in an outer scope.To make a local reference to an object in an outer scope with the same name, it needs to be passed in as a function parameter, because otherwise, the inner name will shadow the outer name because of hoisting.
The text was updated successfully, but these errors were encountered: