user1275375 user1275375 - 3 months ago 18
Javascript Question

Formatting the output in console.log in javascript

I want the output displayed in webconsole using console.log in a table format is it possible to print it. For example i have two variables x and y whose values keep changing. Can i print this variables in a table in console.

Answer

Use

console.dir(someObject);

Make sure your output is object.

Also you can find some other console commands at firebug website http://getfirebug.com/logging

For google chrome see official docs

Comments