On Tuesday I'm doing a talk at +YEGrb on some lesser known JavaScript debugging tips, and would like to know if you've got any I should share?

Cross-browser tips are best but browser specific are ok to.

I'll update this post with tips as I go. Here's what I've got so far:

Firebug Command Line API (Firebug, Chrome, ~IE, ~Firefox) - this API may have started in Firebug but is fully supported in many other browsers. Use it to quickly query the DOM, inspect objects, and retrieve references to elements selected in the inspector. (http://getfirebug.com/wiki/index.php/Command_Line_AP)

console.dir() (Firebug, Chrome, IE, Firefox) - console.log() is great for recording strings, but sometimes you want to see a proper representation of a JS object. Use console.dir() to see an ineractive representation of a JS object.

console.dirxml() (Firebug, Chrome) - Web developers think in markup, so sometimes you want to see DOM objects in an xml format. dirxml() is there for you.

monitorEvents() (Chrome, Firebug) - Logs to the console events which are triggered on an object. For example, monitorEvents(window, "key") logs key events.

debugger keyword (Firebug, Chrome) - Setting breakpoints in your browser is great, but sometimes you need to conditional trigger debugging. Using the debugger keyword you can invoke your browser script debugging from your source. Just don't forget to remove these calls before you hit production!

Webkit Remote Debugging (Chrome, Playbook, more soon?) - A remote debugging protocol is now supported in WebKit and is slowly being added to WebKit based products. This allows you to connect Developer Tools to instances of WebKit running on another device on your network. Both iOS and Android are expected to support this in future releases but have made no specific announcements. (http://www.webkit.org/blog/1620/webkit-remote-debugging/)

Remote Debugging with JSConsole (all browsers) - When remote debugging isn't available the next best option is JSConsole.com. You can launch it on your desktop, then insert a script tag into the page you would like to debug. You can then run JavaScript commands in the browser on your desktop and see the results of running the JavaScript in the page you're debugging. (http://jsconsole.com/remote-debugging.html)

XHR breakpoints (Chrome) - Debugging communications with the server can be slow and painstaking, especially if you don't have access to your server logs. By setting an XHR breakpoint you can inspect the request send from your browser directly to ensure it's being formatted properly. This is also a good tool for tracking down errand XHR requests in your application. It can be restricted by URL if you don't want to see all requests.

DOM breakpoints (Chrome) - Curious which JavaScript code is modifying your DOM elements? You can right-click an element the inspector and then break when it's attributes or sub-tree are modified, or when it's removed.

Pause on exceptions (Chrome) - Investigation exceptions in your code can be tricky. Chrome lets you set JS breakpoints on handled and unhandled exceptions.

Edit JavaScript On-The-Fly (Chrome) - Think you know what's causing an exception, with Chrome you can edit your JavaScript without reloading the page to test your changes.

Pretty print minified JavaScript (Chrome) - Are you debugging minified code in production? This can't restore your original variable names, but it will add spacing and breakpoints to make the source more readable while you debug.

Track client-side errors with Analytics (Chrome, Firefox, IE) - This tip comes from +Aicke Schulz, who suggested using GA's _trackEvent() call to capture errors from window.onerror in your Analytics stats.
Shared publiclyView activity