博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
console.dir() 与 console.log() 区别
阅读量:5221 次
发布时间:2019-06-14

本文共 366 字,大约阅读时间需要 1 分钟。

Difference

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

Example

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

转载于:https://www.cnblogs.com/hzj680539/p/5095532.html

你可能感兴趣的文章