0

When I display an array in the F12 Dev Tools to try to figure out what is going on in a JavaScript program, I don't get the brackets. Normally, this wouldn't be a problem. But, I am currently working on a project with multidimensional arrays. So, seeing the brackets would be helpful.

I would also like to know how to see the contents of an object. All I see in the Dev Tools console is "object".

I can use Chrome, FF or IE to do this. So, a solution in any of these three Dev Tools would be OK.

Thanks.

2 Answers 2

0
var myobj = {a: 5, b: "cat", c: ["asdf",1324,353]};

console.dir (myobj);
1
  • @phrazzled Your welcome :)
    – gregn3
    Dec 4, 2017 at 16:04
0

I wanted to add another way to do this:

I was looking at the Developer's Tools in Chrome.

If I set a breakpoint in the code and then use the Sources tab, I can see all sorts of values of variables, objects, arrays, etc.

Just wanted to add this in case someone else looks at this post.

You must log in to answer this question.