Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome displays different object contents on expand

Why does Chrome display two differing datasets depending on if you have the object view expanded?

In contracted view, my object has two properties:

enter image description here

In expanded view, my object has three properties:

enter image description here

like image 236
user3871 Avatar asked Feb 03 '17 19:02

user3871


People also ask

How do you expand all code in inspect element?

If you hold ctrl + alt for windows (just opt on a mac) while clicking on the arrow of the element you want to expand, it will expand and all of its children will expand. So, if you ctrl + alt click on the <html> tag, that should expand the entire page.

What is developer tool in Chrome?

Chrome's Developer Tools allow you to quickly analyze the content/resources of a webpage. This helps you check your Campaign Manager 360 tags.


1 Answers

The object you see in the console is a snapshot of the object at a particular point in time - the time when you logged it. When you expand the object, it will evaluate the properties again.

In the example below, I have created an object with two array properties. I logged it the console, and then I added a third property, c to it.

Snapshot

Only the first two properties are showing still, even though I just added a third property. After expanding the object in the console, I can see the third one. It is the latest state of the object.

Evaluated

If you hover over the little blue i icon, it explains what it has done:

Value below was evaluated just now.

like image 155
Gideon Pyzer Avatar answered Nov 16 '22 01:11

Gideon Pyzer