Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view extended objects/arrays in Chrome console?

When I have array of objects, when I type the name of variable in Chrome console, I get this: enter image description here

QUESTION: Is there some option or a flag which when turned on would display the objects and arrays extended when queried in Chrome console ?

I use the console a lot and do inline operations within the console and each time when I modify an array I have to click on all entries to see the values.

I do not want to write a loop which would console.dir out all the arrays.

like image 575
lukas.pukenis Avatar asked May 21 '12 17:05

lukas.pukenis


People also ask

How to copy things out of chrome's console?

I just learned this easy method of copying things out of Chrome's console. When you see the data in the console, right click on it to store as global variable. Chrome will store it as a temporary variable called temp1

How to list all variables in Google Chrome?

All the variables in Google Chrome can be listed for the use of debugging. There are two approaches to list all variables: Method 1: Iterating through properties of the window object: The window object in JavaScript represents the current browser’s window. The properties of this object can be used to find the variables of the Chrome browser.

How to use global variables in the Chrome console?

When you see the data in the console, right click on it to store as global variable. Chrome will store it as a temporary variable called temp1 Once you have your variable, just use the copy () function.

How can I see the contents of an array in JavaScript?

To see the entire contents of an array (or any other object, for that matter) without writing a loop, you can use JSON.stringify. This will output the whole object in JSON format, optionally indenting it.


Video Answer


1 Answers

console.table()does a great job of displaying arrays neatly in a table format.

like image 109
abettermap Avatar answered Oct 08 '22 00:10

abettermap