Reading the specs, it becomes clear that all vars are instantiated
before execution (Matt said parsed, but to avoid doubt their values
aren't evaluated).
Thus:
function() {
myVar = 5;
var myVar = 6;
}
is the equivalent of:
function() {
var myVar;
myVar = 5;
myVar = 6;
}
is valid, and keeps myVar in the function scope.
Could lead to some very obtuse code!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---