2

Is there a javascript version of PHP's krumo()? It's really helpful.

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
enchance
  • 29,075
  • 35
  • 87
  • 127

2 Answers2

4

Use console.log(). If your object is myObject, call it like:

console.log(myObject);

Then open the Javascript console in your browser (Chrome, Firefox, Safari, IE, etc.) to see the output.

Back in the early days, you needed to install an extension like Firebug, but all modern browsers now include this helpful debugging functionality.

Simon East
  • 55,742
  • 17
  • 139
  • 133
Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187
  • Besides Firebug, webkit also supports `console.log()` and Chrome's inspector (can't speak for Safari) provides this collapsable representation of an object that Krumo has. – Bailey Parker Jan 08 '12 at 07:51
3

Firebug is one of the best tools to debug JavaScript. You can preview all variable content in addition to debug HTML and css.