Computer >> Computer tutorials >  >> Programming >> Javascript

Difference between console.dir and console.log in javascript?


The console method log() displays the toString representation of any object passed to it.

The Console method dir() 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.