169
rated 0 times
[
176]
[
7]
/ answers: 1 / hits: 24780
/ 15 Years ago, sun, april 26, 2009, 12:00:00
What's the difference between:
function bar()
{
for (x=0; x< 100; x++) {}
}
And
function bar()
{
var x;
for (x=0; x< 100; x++) {}
}
If x wasn't declared outside of that function, and so it wasn't a global variable? I always wonder this because I generally don't declare throwaway variables which are used only in a loop, but I wonder if this might break comparability in a browser or such.
More From » javascript