Is there any sort of interactive debugger for JavaScript? I'm imagining something like a web page on the left, and a REPL interface on the right.
Or maybe even without having a web page, so I can just play around with the JavaScript language.
Something that doesn't require I refresh the web page with breakpoints in Firebug or VS to examine locals and type code into a Watch window. Maybe I just need to learn Firebug better?
JavaScript doesn't have to be compiled, after all.
Kind of like LinqPad but for JavaScript maybe?
Anyone follow me here?
There are 2 ways to use a REPL when debugging. Way 1: Open an empty REPL (like IPython, pry, or a browser Javascript console) to test out something. This is great but it's not what I'm talking about in this post. Way 2: Set a breakpoint in your program, and start a REPL at that breakpoint.
Now you can start adding breakpoints to your repl: breakpoints are lines of the code where the program will be paused during execution while debugging.
But fortunately, all modern browsers have a built-in JavaScript debugger. Built-in debuggers can be turned on and off, forcing errors to be reported to the user. With a debugger, you can also set breakpoints (places where code execution can be stopped), and examine variables while the code is executing.
Node.js has a REPL.
On Mac OS X:
brew install node node
.exit to exit the repl, .help for other options
http://nodejs.org/docs/v0.3.1/api/repl.html
Stand-alone REPL (no browser/DOM, just JavaScript): JavaScript Shell from the Rhino project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With