JavaScript Variable Scope
Dflying | 10 March, 2006 17:39In JavaScript, there's a 'wired' feature that the variable scope is only the function. For example, in the following code:
var i = 1; { var i = 2; } alert(i);
You will get 2 alerted. That's really interesting and everyone should pay more attention to.
Posted in
JavaScript & AJAX.
Comment: (0).
Trackbacks:(97).
Permalink
«Next post |
Previous post»




