JavaScript idiom: create a function only to invoke it

前端 未结 2 1546
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 01:37

I am learning YUI and have occasionally seen this idiom:

 

Why do they create

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 02:12

    They want to avoid namespace collisions, I'd guess. Seems as a good practice in JS.

提交回复
热议问题