console.dir(object) displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.

var myObject = {
    "foo":{
        "bar":"data"
    }
};

console.dir(myObject);

displays:

http://i.stack.imgur.com/rMkPQ.png

console.dirxml(object) prints an XML representation of the descendant elements of object if possible, or the JavaScript representation if not. Calling console.dirxml() on HTML and XML elements is equivalent to calling console.log().

Example 1:

console.dirxml(document)

displays:

http://i.stack.imgur.com/tqrL4.png

Example 2:

console.log(document)

displays:

http://i.stack.imgur.com/E4owD.png

Example 3:

var myObject = {
    "foo":{
        "bar":"data"
    }
};

console.dirxml(myObject);

displays:

http://i.stack.imgur.com/gBRKi.png