console.dir() 与 console.log() 区别

Difference

  • console.log prints the element in an HTML-like tree
  • console.dir prints the element in a JSON-like tree

Example

console.dir() 与 console.log() 区别

Specifically, console.log gives special treatment to DOM elements, whereas console.dir does not.

This is often useful when trying to see the full representation of the DOM JS object.

SEE ALSO *

上一篇:Hibernate内存溢出分析一例


下一篇:JS之For---in 语句