Code JavaScript:for (var i = 0, f; f = files[i]; i++) { ParseFile(f); }
I don't understand how you can have: var i = 0, f;
I'm confused by the f. Am I just initializing f here and setting it to null? I can also read it as "var i = 0, then i = f".
| SitePoint Sponsor |
Code JavaScript:for (var i = 0, f; f = files[i]; i++) { ParseFile(f); }
I don't understand how you can have: var i = 0, f;
I'm confused by the f. Am I just initializing f here and setting it to null? I can also read it as "var i = 0, then i = f".

Hi there,
this:
Code JavaScript:var i=0, f;
is a shorthand version of:
Code JavaScript:var i = 0; var f;
So here, you are just initializing f
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
Thanks for clearing that up for me, Pullo. Now it makes sense to me.

You're welcome!
It made me look twice, the first time I saw it![]()
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
Bookmarks