-1

Could I get an explanation of the follow code snippet?

(function()
{
    alert();
})();

This looks like an anonymous function and the alert() function gets executed. I don't understand the semantic meaning of the outer parentheses. What does this part of the snippet mean?

(


 )()
user8056359
  • 437
  • 1
  • 7
  • 16

1 Answers1

-2

this represents the immediately executable function. in easier way, it means that function being declared and called/executed simultaneously.

Arpit Arya
  • 123
  • 6