Вопрос

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