Hi,
I'm not a JavaScript Ninja so my question may sound really silly.
Is there a way to run JavaScript code outside the browser. I'm looking for something like:
terminal $ jsvm binary-tree.js
Thanks all.
Another solution is using JRE6 Scripting API (javax.script.*). This is suitable if the JS code does not involve changing its container - for example, you can't use this to reliably run JS code that manipulates browser DOM.
It's good for testing data structures, or following DRY principles (example: parameter validation rules can be coded just once in JS and invoked from both client side and server side).