Function test (){
Return 123;
}
Obviously, this is a function declaration. What about the following?
Var B = function () {return 123 };
We suspect that this is not a declaration. Because the function has no name, it is just an anonymous function. Well, let's look at it again.
Var B = function test () {return 123 };
Is this a function declaration? It seems like, then I will answer you, "no"
Alert (test );
Var B = function test () {return 123 };
You can test any js implementation on non-ie, and the test undefined error will be reported. What if so?
Var B = function test () {return 123 };
Alert (B );
Alert (test );
Function test () {...} is displayed (){...} the toString result of this function can be the second alert or exception. Why? That is to say, function test () {return 123} is not a declaration, but a function object, put the reference in B, so the function object will not be bound to the test name by default like the declaration. Why don't I use ie for testing?
Alert (test );
Var B = function test () {return 123 };
Ie will display the function. ie is stupid and will not distinguish between the independent function declaration and the function object on the right. In addition, ie even supports function String. prototype. test (){...} such a statement shows that there are quite a few js bugs in ie. It is no wonder that wilson does not support es4. He has to make an es3.1 release. It is actually his own bug correction version.