Can someone clarify me out if the following code snippet represents anonymous function or Not?
var alpha = (function(){
/*
private space
*/
return{
//Some Code Here ...
}
})();
Is this an anonymous function? This looks like structure of anonymous function to me, but I read that anonymous function is one which has no name. Here I think alpha(variable) is the name assigned to the function, so that contradicts the concept.
I know if it would have been:
(function(){
return{
//Some Code Here ...
}
})();
Then this would have been Anonymous Function(self invoking) or IIFE.
Also, following is a simple function but Not Anonymous, because beta is assigned to the function (like my example above). So, if this is not anonymous function (as beta is pointed to function & represents it), then how can my previous function (alpha pointing to function) can be anonymous? Also, self invoking is extra part. Just because a function is self invoking doesn't make it Anonymous I believe.
var beta = function(){
//Some code
}
Can someone clarify me out?
(function)();, but later assign it's value toalpha