[英]How to get local variables array with firefox/firebug/chrome debugger?
Does firefox/firebug/chrome debugger provides api for getting array of local variables in console? firefox / firebug / chrome调试器是否提供用于在控制台中获取局部变量数组的api? Or there is some software that provides api like that?
还是有一些提供api这样的软件?
Local variables, as in those scoped within a function? 局部变量,如函数范围内的变量?
No, you wouldnt be able to view those unless you expose them from within the function using this
or prototype
不,除非您使用
this
或prototype
从函数内部公开它们,否则您将无法查看它们
EDIT: More information 编辑:更多信息
function Car(color){ this.color = color; }
var myCar = new Car("red");
myCar.color // This would output red, and if myCar was globally defined you could view it.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.