In javascript (function ($) {...}) (jQuery), what does it mean? javascriptjquery
In javascript, what is the meaning of (function ($) {...}) (jQuery.
========================================================== ==========================================/// This is a split line.
First function (arg ){
//....
}
This form is called an anonymous function in javascript. Arg is the parameter of the anonymous function.
And (function ($ ){
}) (JQuery); in this form, an anonymous function is executed and the parameter jQuery is passed.
========================================================== ========================================================/// This is a split line
In fact, it is equivalent
Var func = funtion ($ ){
//.....
};
Func (jQuery );
========================================================== ==================================================================/// THIS IS split line
In fact, these two statements mean one thing. It is simply written in the above form.
(Function ($) {...}) (jQuery)