如何获得本地变量数组与firefox/firebug/chrome调试器

How to get local variables array with firefox/firebug/chrome debugger?

本文关键字:firefox firebug chrome 调试器 数组 何获得 变量      更新时间:2023-09-26

firefox/firebug/chrome调试器是否提供api用于在控制台获取本地变量数组?或者有一些软件提供这样的api ?

局部变量,如在函数内的作用域?

不,您将无法查看这些,除非您使用thisprototype从函数中公开它们

编辑:更多信息

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.