Firebug multiple lines in console not working properly

南笙酒味 提交于 2019-12-12 04:37:34

问题


Firebug doesn't show all lines in console. If my code looks like this:

var  arr=[4,3,2];

console.log("console");
arr; 

result is in two lines as it should be:

console
[4, 3, 2]

but when it's a different order, only one line is shown at the end:

arr;
console.log("console");

result:

console

Problem appears with everything, and only using console, you can receive additional output line if it's put before array/object/function invokation, otherwise other outputs are skipped. Is there a way to make firebug produce input=>output result in console without actually skipping anything ?? If it's not possible, is there a different tool(with js compiler) that could do that ??


回答1:


Firebug and other browser developer tools output the return value of the evaluated script. Because there can only be one return value, you only get one output.

If you want to get more outputs, you need to use the Console API methods like console.log().

Instead of using the console for debugging your code, you may want to use the JavaScript debugger instead. In Firebug the debugger is available within the Script panel.
This allows you to stop the script execution at some line and see the values of all variables at that specific point of your code.



来源:https://stackoverflow.com/questions/39731544/firebug-multiple-lines-in-console-not-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!