Little brother recently is very upset Ah, not only to continue to the current front-end small white, the future of the front-end siege lion's identity bitter study, but also to use the remaining time to complete the graduation design. I knew so, originally I for Mao to apply for mathematics such a bitter force professional .... Yesterday all day time in research Bishi, feel the code already did not know me ... Today in the study, suddenly found the anonymous function call method. Originally thought that the anonymous function is a high-cold creature, only the following method of invocation:
(function() { alert (' water '
Of course... Set the parameter to the same method as above:
(function(i) {alert (i);}) (
Later read a script home of an article, only to find this goods originally so no moral integrity ... All kinds of call methods can make this goods obediently work ...
The first is chained invocation:
(functionreturn Arguments.callee;}) (
The output is Water,down
Then there are various calling methods: First of all, say the most efficient of execution:
void function () {alert (' water ')
And then the other way:
~function() {alert (' water ');} ();! function () {alert (' water ');} (); -function() {alert (' water ');} (); +function() {alert (' water ');} ();
And finally, the one who took off his pants and fart.
(function() {alert (' water ');} ());
。。。 Summed up, we think that the good use of which it ~ small brother here thank the original: http://www.jb51.net/article/24759.htm
Finally, I wish you all the programming road more and more wide.
Summarize the next JS in the anonymous function of writing ~ For several days did not blog ...