首页 > 其他 > 详细

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

时间:2016-01-03 00:38:58      阅读:658      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!