Look at the following code:
var a = function(t) { return t; }
(1 2).toString();
alert(a);
What is the result?
In fact, the main problem is that there is no semicolon after the first line, so it is actually var a = function(t) { return t; }(1 2).toString();
Create variable a first , then execute the assignment statement, the anonymous function passes in parameter 1 2 for execution, returns the result .toString(), and assigns it to a.
For details on how to write function() {}(), please refer to the js namespace.