development environment - How can I execute a JavaScript file easily? -


when learned perl , python, "development environment" consisted of vim , shell. write program in vim, execute command line. aware spidermonkey engine available standalone interpreter, i'm not sure how practical is.

the "intuitive" way js incorporate script web page , view in different browsers, seems cumbersome. have seen recommendations firebug, couldn't quite hang of it.

i know there several js-oriented plugins vim, again don't know how practical are.

i want write script, , check syntax , output, quickly. interested know how actual js developers go testing code.

i use node.js lot, answer biased that, but...

  1. for learning language, node.js gives easy-to-use (like python, ruby, et al) repl typing node @ command line.
  2. validation of website nicely done zombie, headless browser implemented in node.js. if javascript syntactically wrong, try load page you'll error. if javascript semantically wrong (bad logic), tests write verify proper behavior of code fail.
  3. you'll have test in firefox, ie, etc, not in chrome because both use same v8 engine (you might want cursory glance, of course). ie, know, has greatest number of deviations other browsers not implementing features or giving them different name. firefox, surprisingly, quite deviant, not in missing features in having many features in javascript language no other browser has (they proposed part of ecmascript standard rejected) it's good idea not start there if want code run on every interpreter.

with node.js you'll have 1 of faster server-side interpreters @ command (faster python , ruby, equal lua, , java's level, , somehow v8 has fastest regex engine in world), , server-side code matches client-side code, makes things rpc layers nicer work with.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -