[removed] Access own Object Property inside Array Literal

前端 未结 2 1304
暖寄归人
暖寄归人 2020-12-06 07:36

Given an Array Literal inside a JavaScript Object, accessing its own object\'s properties does not seem to work:

 var closure =  {

         myPic : document         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 08:03

    The this property does not point to the closure object. If we were to define the myPic property on the global scope, then you will see picArray initialized with that value. Consider this example:

    
    

    this is one of the hardest concepts in JavaScript. You might like this article on the topic.

提交回复
热议问题