5

I found some places people are writing JavaScript with starting function (undefined).Can I know why they are writing like this what is the advantage and disadvantage of using like this

(function(undefined) {
    /* some logic functions etc..*/
})();
Tushar
  • 78,625
  • 15
  • 134
  • 154
  • Although the linked answers explains why, though I think there's no advantage to this approach. As per ECMAScript 5, undefined is not writable,configurable so its not an issue anymore in modern browsers even if its not strict.. – Anirudha Jul 25 '16 at 10:59

0 Answers0