The private attribute is available in java, and the powerful function js cannot be implemented as a dwarf, anonymous function, and wide variety of functions.
If an anonymous function has no actual name or pointer, how can this problem be solved?
In fact, you can understand the meaning of parentheses. Parentheses return values, that is, the return values of functions or expressions in parentheses. Therefore, the return values of functions in parentheses are equal to the return values of parentheses, which is not hard to understand (function (){})() you can execute a function without a name...
The writing of anonymous functions is very divergent ~
// The most common usage:
(Function (){
Alert ('water ');
})();
// Of course, parameters can also be included:
(Function (o ){
Alert (o );
}) ('Water ');
// Do you want to use the chained call of anonymous functions? Simple:
(Function (o ){
Alert (o );
Return arguments. callee;
}) ('Water') ('low ');
// All common anonymous functions are available. See the following:
~ (Function (){
Alert ('water ');
})();
// The writing method is cool ~
Void function (){
Alert ('water ');
}();
// It is said that the efficiency is the highest ~
+ Function (){
Alert ('water ');
}();
-Function (){
Alert ('water ');
}();
~ Function (){
Alert ('water ');
}();
! Function (){
Alert ('water ');
}();
(Function (){
Alert ('water ');
}());
// A bit of forcible execution taste ~