> myFunction()
> and
> window.myFunction
>
> are not necessarily the same. the first one will look up the scope
> chain and use the first ocurrence, it doesn't go directly to the
> window object.
The second looks up the scope chain too and uses the first property
named window that it finds. It may not be the window you think it is.
> var x = 3;
> (function(){
> var x = 5;
> alert(x);})();
>
> alert(x);
>
> Again, this is basic javascript
Basic ECMAScript.
--
Rob
No comments:
Post a Comment