thể trùng lặp:
Is Chrome's JavaScript console lazy about evaluating arrays?Tại sao Chrome hiển thị giá trị bị xóa khỏi mảng trước khi nó được?
console của Chrome js được hiển thị một mảng với một giá trị xóa trước khi giá trị này sẽ bị xóa. Tại sao?
jsFiddle that demonstrates this behavior.
var list=[];
list.push("one");
list.push("two");
list.push("three");
console.log(list); //["two", "three", undefined × 1]
$("#output").append(JSON.stringify(list));//["one","two","three"]
list.shift();
$("#output").append($("<br>"));
console.log(list); //["two", "three"]
$("#output").append(JSON.stringify(list));//["two","three"]
Có thể có nhiều câu trả lời có thẩm quyền hơn về các câu hỏi tương tự: http://stackoverflow.com/questions/4198912/bizarre-console-log-behaviour-in-chrome-developer-tools, http://stackoverflow.com/question/11214430/sai-value-in-console-log, http://stackoverflow.com/questions/11118758/bug-in-console-log –
http://stackoverflow.com/questions/4057440/is-chromes -javascript-console-lazy-về-đánh giá-mảng? lq = 1 –
chúng tôi có một loạt các câu hỏi trùng lặp cho vấn đề này? –