问题
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