|
function(x){return function(){alert(x)};}(i)
That is the parameter being passed to the function that will substitute into the "x" argument within the function.
This is the format because it is an anonymous (unnamed) function. It is the equivalent of the following if we give the function a name of "func".
function func(x) {return function(){alert(x)};} // defines the function
func(i); // runs the function
|