How does this JavaScript/jQuery syntax work: (function( window, undefined ) { })(window)?

后端 未结 5 1495
暗喜
暗喜 2020-11-22 00:30

Have you ever taken a look under the hood at the jQuery 1.4 source code and noticed how it\'s encapsulated in the following way:

(function(          


        
5条回答
  •  生来不讨喜
    2020-11-22 01:12

    Tested with 1000000 iterations. This kind of localization had no effect in performance. Not even a single millisecond in 1000000 iterations. This is simply useless.

提交回复
热议问题