4 ms·
Use console.log() instead of alert. In Firebug you can do this with any object and inspect it. But be aware that those objects are "live" - if they change at so
by drumdance 15y ago
Use console.log() instead of alert. In Firebug you can do this with any object and inspect it. But be aware that those objects are "live" - if they change at some poing later in your code, the console object will update. If I need to inspect an object in isolation, I throw an exception right after console.log()
- artursapek 15y agoI shortened console.log() with a function I use in development called c() function c(x){ console.log(x || "!"); } It's pretty helpful, I can quickly throw the line c(); anywhere just to log if it happens when/if it should. And it stays out of your way, unlike alert() which is terrible and should be deprecated.
- masklinn 15y ago> But be aware that those objects are "live" - if they change at some poing later in your code, the console object will update. Not in firebug (anymore), although the hyperlink will lead to the object itself, in its new version: http://jsfiddle.net/sgGEW/ http://jsfiddle.net/sgGEW/ The Webkit console does have that issue.