I've been trying out JavaScript mapping APIs from Google and Microsoft, which prompted me to revisit the question of JavaScript IDEs and debuggers. My first stop was Visual Studio, since I use it anyway for Windows and ASP.NET development, and I was impressed by how well it works even for projects that do not use Microsoft technology. Take Google Maps, for example. Fire up Visual Studio 2008 (earlier versions are less good for this) and start a new project using the Empty Web Site template. Right-click the solution, Add new item, and choose HTML page. I always name these with an .html extension, not the default .htm which exists solely because DOS could not cope with four-letter file extensions, but it is a matter of taste. You now have an empty web page. Click Debug, and let Visual Studio add a web.config with debugging enabled even though you will not be using this for deployment. You will also be prompted to turn on debugging in Internet Explorer, if you have not already - yes, you have to uncheck disable:

If you then try to debug, Visual Studio fires up its internal web server and opens the blank page in Internet Explorer. So far, so good. Next, I added the code to display a Google map - it's only a few lines of JavaScript. Visual Studio does a good job with syntax highlighting and code completion, for types that it knows about. I found that I could easily set breakpoints and inspect variables; everything worked smoothly:
You can even debug into the incomprehensible Google library code if you feel so inclined - just press F11 to step into the code. You also get windows for autos, locals, watched variables and call stack; and there is an immediate window.
There are a couple of snags with this. One is that browsing the web with debugging fully enabled in IE is painful, either because the web is littered with broken JavaScript, or because IE breaks easily; I guess both of these are true, and you will see constant debug dialogs. A solution is to use a different browser for everyday use. The good news is that this is said to be fixed in IE8; Visual Studio will turn on debugging in IE8 on demand, though I have yet to try this.
The other unfortunate aspect is that attempting to debug with other browsers does not work in the same way. You could edit in Visual Studio and debug with something like Firebug; but you lose the smooth integration. IE8 mitigates this a little, because it is more standards-compliant so its JavaScript engine and DOM is closer to that in FireFox and Safari, but there is still no substitute for debugging in all the browsers that matter. Of course we will also have to cope with IE7 for the forseeable future.
Still, if you are a Windows developer casting about for a JavaScript IDE, don't forget the one you most likely already have installed.