码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-01-03 00:41:54      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:

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 stackoverflow

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

标签:

原文地址:http://www.cnblogs.com/hzj680539/p/5095532.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!