I don't know of any other language in which this kind of scoping applies. I'm 
sure they exist, so don't take this as an invitation to start listing them. If 
you don't think the code I listed has odd scoping rules, you likely haven't 
much experience with a variety of languages.


----- Original Message ----
From: Rod Whiteley <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, July 2, 2006 4:41:28 AM
Subject: Re: [Project_owners] Javascript question

On 01-07-2006 14:55, Eric H. Jung wrote:
> for (var i=0,j="foo";i<5; i++) {dump(i);}
> dump(j);

What breaks?  And what does 'everything "global"' mean?

The var creates both i and j in the current scope.  So if your code is 
global code, both i and j are global; if your code is function code, 
both i and j are local.  In JavaScript, local always means local to a 
function--there is no other kind of local.

-- 
Rod Whiteley
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners



_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to