문제

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