what means “a word:” before define a function in javaScript?

前端 未结 1 1212
Happy的楠姐
Happy的楠姐 2020-12-12 07:20

I have a javaScript sample: in this sample is used words and \":\" before define function. what is it? please help me...

Jb.prototype = {clickButton: functio         


        
1条回答
  •  爱一瞬间的悲伤
    2020-12-12 07:32

    This is an object literal with function expressions in it. Do you know about object literals?

    x = {asdf: 1, fdsa: 2}
    

    will create an object with properties asdf and fdsa set to 1 and 2 respectively. The object literal in question simply has much more complex property values.

    0 讨论(0)
提交回复
热议问题