質問

In firebug, does anyone know why the length = 0 in the first line and when I click on it to expand, it says that the length = 3.. Shouldnt both be equal? SAme goes with models:Array[0] but in the expand version it is Array[3]

firebug screenshot

役に立ちましたか?

解決

The console log captures the current state of the object, the later update of the object is reflected when you expand it. You can try in console the below to see how it behaves.

  var test = {length:0,models:[]};
   console.log(test);
   test.length =4;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top