Heartfelt sigh, JS really annoying.
Learn now, gradually understand what is: language is universal, no good, only good at not good.
Inheritance, polymorphism, even pointers, C can be achieved, C++,java, JavaScript (and Java is Lei Feng and Leifeng Pagoda, the difference between the name does not know how many people) can also be adapted to achieve.
Restudying, today again, the anonymous function as a function parameter.
The code is very short, spite.
anonymous function as a function parameter, why can it be performed automatically?
Does the anonymous function run itself?
Wrong!!! anonymous Function! = self-Executing anonymous function
There are only 1 truths: Anonymous functions are invoked as arguments in a function called (which takes an anonymous function as an argument).
function Test (A, b) {
a+=1;
B is an object, the function name is also an object, so B can refer to a function
//similar to the function name in C + +/
A is copied to B (result)
//JS Good flexible
B (a);
}
The above JS anonymous function as a function of the parameters of the detailed explanation is small to share all the content of everyone, hope to give you a reference, but also hope that we support the cloud-dwelling community.