On Jul 7, 1:00*pm, QQ <chaojiang...@gmail.com> wrote:
> Hi All
>
> When I looked at ExtJS source code, I found something strange.
>
> could anyone here explain to me?
>
> In ext-base.js file
> they wrap the all code inside:
>
> (function() {
> ...
> ...
> ...
>
> )()
>
> What is that mean?
>
( expression )( parameters )
Evaluate "expression" and (try to) call the result as a function with
the parameters "parameters".
"expression" does not need to be a "literal function" expression.
for example :
var p= "Hola";
var f= function (p) { alert(p) };
var g= function () { return f };
var h= [f, g];
(f)(p);
(g())(p);
(h[0])(p);
(h[1]())(p);
(window.alert)(p);
(function (q) { alert(q) })(p);
http://tinyurl.com/68ffac
--Jorge.