jQuery function declaration explanation

前端 未结 4 1950
-上瘾入骨i
-上瘾入骨i 2021-01-22 22:09

I\'ve opened jQuery 1.7.1 library and wanted to study the code, but I\'ve found a that functions are declared in strange way (for me). For example:

show: functio         


        
4条回答
  •  梦谈多话
    2021-01-22 22:36

    The first declaration, i.e., show: function, defines show to be a field in an object having type function. The second declares a function named show within the current scope (possibly global?)

提交回复
热议问题