Why is Chrome showing a value as being removed from an array before it has been? [duplicate]
- 阅读更多 关于 Why is Chrome showing a value as being removed from an array before it has been? [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? Chrome's js console is showing an array with a deleted value before the value is deleted. Why? 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")