Inner function cannot access outer functions variable

后端 未结 5 623
攒了一身酷
攒了一身酷 2021-01-13 10:14

I have created the following jsfiddle which highlights my problem. http://jsfiddle.net/UTG7U/

var ExampleObject = function() {
   var myArray = new Array();         


        
5条回答
  •  执笔经年
    2021-01-13 10:44

    You don't need the this.myArray. Using myArray alone will suffice (and work).

提交回复
热议问题