Meaning of '{ }' in javascript

后端 未结 7 680
余生分开走
余生分开走 2021-02-07 17:37

What does assigning a variable to {}, mean? Is that initializing it to a function? I have code in a javascript file that says this

GLGE.Wavefront =          


        
7条回答
  •  孤城傲影
    2021-02-07 18:08

    It's an initialized empty object, eg. an object of no particular type. It serves to provide a definition for this.materials so that the code won't have to check it for null or being defined later.

提交回复
热议问题