I think this post has gone way off course, and yet there really isn't
any disagreement among us; it's mostly imprecision in language giving
rise to ambiguity :P
My apologies to lovespring for making a simple question require so
much scolling :)
So to try and bring this back to the OP:
1.does it
" x=3; // This does _not_ change the global x!"
No, it doesn't change the global, because it's declared with var in
the function first, so x in the function isn't global, it's lexically
scoped to the function; x in the inner function is lexically scoped to
the containing function (x within the ou
On Mar 15, 12:00 pm, mkmanning wrote:
> Not sure what you mean "inline" or by "scope the vars inside";
> variables declared inside the function are scoped "inside" (they have
> lexical scope to the function), as long as they are preceded with the
> var declaration (if not, they are global, even w
"withn the flow of text"? Still not getting the usage, maybe you can
point me to a specific reference of "inline" as common usage in
JavaScript. Inline in common JavaScript usage (since it is 99.9% of
the time DOM related) usually refers to javascript (usually event
related) within markup, such as
"withn the flow of text"? Still not getting the usage, maybe you can
point me to a specific reference of "inline" as common usage in
JavaScript. Inline in common JavaScript usage (since it is 99.9% of
the time DOM related) usually refers to javascript (usually event
related) within markup, such as
> Not sure what you mean "inline" or by "scope the vars inside";
> variables declared inside the function are scoped "inside"
Yes. Isn't that what I said?
Re inline: I meant inline as in...well...inline. ;-) I'm not sure
how else to say it; within the flow of the text rather than outside
it.
Not sure what you mean "inline" or by "scope the vars inside";
variables declared inside the function are scoped "inside" (they have
lexical scope to the function), as long as they are preceded with the
var declaration (if not, they are global, even with this format).
The closing/end parens creat
Hi,
On Mar 15, 12:55 pm, lovespring wrote:
> (function(){})();
> does it conform to the grammar?
Yes, it does. That line defines a function inline:
(function(){})
...and then calls it immediately using () like any other function:
(function(){})();
(You need the parens around the de
8 matches
Mail list logo