(function (a) {
console.log(a);
}(x()));
function x()
{
return "XXXXX";
}
/*console.log is XXXXX*/
var x = "AAAAAAA333AA";
(function (a) {
console.log(a);
}(x));
/*x must be already defined at the time*/
(function (a) {
a();
}(
function(a, b, c)
{
alert("aaaaa");
}
));
/*you can just think of this as "in this self invoking function, we now can use the function(a, b, c) function......in any way we see fit*/
/*notice how the parameters in the bottom function don't really matter in terms of being executed even though they are not being used at all*/