Possible Duplicate:
JavaScript scope and closure
JavaScript - self executing functions
What is the difference between the following code:
var someVar = (function(){
// some code
})();
And
var someVar = function(){
// some code
};
Can you point me to tutorials on the usage and explanation of first code?
It is hard to find the answer on Google, so I thought I would ask it here.
Thank you.