Skip to content Skip to sidebar Skip to footer

Firebug Console Shortening Strings In Array Logged?

I have a custom logging function to log to the firebug console that looks like this: // the name here is just for fun function ninjaConsoleLog() { var slicer = Array.prototype.

Solution 1:

Try changing it to console.dir(args) instead of console.log(args)

Also you should be able to click on the values in firebug console to expand them to their full values There will be either a plus in a box symbol or when you mouse over the value it will become underlined, which means clicking on it will expand to its full value

Solution 2:

If you want view the entire string(s) without having to expand the individual array items (dir() will list collapsed results), you can call toString() on the array, and Firebug will show you the entire array as a string, e.g.:

var arr = [
           "This is a longish string, like the energizer bunny, it just keeps going and going and going.",
           "Another longish string Another longish string Another longish string Another longish string.",
           "A third longish string A third longish string A third longish string A third longish string."
];
console.log(arr.toString());

... which results in this string:

This is a longish string, like the energizer bunny, it just keeps going and going and going.,Another longish string Another longish string Another longish string Another longish string.,A third longish string A third longish string A third longish string A third longish string.

Post a Comment for "Firebug Console Shortening Strings In Array Logged?"