When I have array of objects, when I type the name of variable in Chrome console, I get this:
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.
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
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.
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.
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.
console.table()
does a great job of displaying arrays neatly in a table format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With