Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:36:43+00:00 2026-06-12T16:36:43+00:00

Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? Chrome’s js console is

  • 0

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").append($("<br>"));

console.log(list);                        //["two", "three"] 
$("#output").append(JSON.stringify(list));//["two","three"]

​

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:36:44+00:00Added an answer on June 12, 2026 at 4:36 pm

    In Chrome console.log is "delayed"; in this case to the end of the Program I believe.

    That is, in Chrome, console.log does not stringify the input object immediately but rather performs the stringification "some time later" (after which the object has been modified in this case) but before it actually displays the result,

    console.log(JSON.stringify(list)) would show the expected result.


    This was reported as a bug as far back as Chrome 5 (the bug-fix target is Mstone-22, so not Chrome 20/21?) and a fix has been added to the webkit base:

    As of today, dumping an object (array) into console will result in objects’ properties being read upon console object expansion (i.e. lazily). This means that dumping the same object while mutating it will be hard to debug using the console.

    This change starts generating abbreviated previews for objects / arrays at the moment of their logging and passes this information along into the front-end. This only happens when the front-end is already opened, it only works for console.log(), not live console interaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? I have the following
Possible Duplicate: Is Chrome's JavaScript console lazy about evaluating arrays? I write next js
Possible Duplicate: Why does javascript object show different values in console in Chrome, Firefox,
Possible Duplicate: If Javascript has first-class functions, why doesn’t this work? In Chrome, the
Possible Duplicate: What makes a jQuery object show up as an array in Chrome's
Possible Duplicate: alias to chrome console.log This is really silly, but I can't abbreviate
Possible Duplicate: What is “undefined x 1” in JavaScript? In Chrome 21, feeding [,]
Possible Duplicate: Intercept calls to console.log in Chrome Can I extend the console object
Possible Duplicate: What makes a jQuery object show up as an array in Chrome's
Possible Duplicate: How to remove border around text/input boxes? (Chrome) Is there a way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.