js中console.log()和console.dir()的区别

console.log()会在浏览器控制台打印出信息

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

console.dir()可以显示一个对象的所有属性和方法

  • console.dir prints the element in a JSON-like tree
posted @ 2019-03-05 10:26  Rocket__Ax  阅读(204)  评论(0编辑  收藏  举报