如何递归探索铬控制台数组 [英] How to recursively explore an array in the chrome console

查看:68
本文介绍了如何递归探索铬控制台数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到一种方法,探索在铬控制台Array对象的(甚至其他控制台一样的萤火虫的),因为我们可以很容易地为其他对象做。

I would like to find a way to explore Array objects in the chrome console (and even other console like firebug), as we can easily do for other objects.

下面是我在Chrome控制台中输入的代码片段:

Below is the snippet I entered in the chrome console :

var str = new String("foo"); str;
var bool = new Boolean(true); bool;
["foo", "bar", str, bool, {}];

和结果在Chrome控制台:结果

And the results in the chrome console :

我能找到的时刻,唯一的方法是怎样的一个黑客:

The only way I could find at the moment is kind of a hack :

[["foo", "bar", str, bool, {}]];

是否有任何选项,命令或方法来只显示数组对象的内部结构,因为它在默认情况下为其他对象做了什么?

Is there any option, command or method to just show the inner structure of the array object as it is done by default for other objects?

推荐答案

这是什么 console.dir()功能是专为:

更多信息请参见:

https://developer.mozilla.org/en-US/文档/ DOM / console.dir

http://getfirebug.com/logging

https://developers.google.com/chrome-developer-tools/文档/控制台

这篇关于如何递归探索铬控制台数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆