浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

https://developer.mozilla.org/en/introduction_to_the_javascript_shell

https://developer.mozilla.org/en/JavaScript/Shells

The JavaScript shell is a command-line program included in the SpiderMonkey source distribution. It is the JavaScript equivalent of Python's interactive prompt, the Lisp read-eval-print loop, or Ruby's irb. This article explains how to use the shell to experiment with JavaScript code and run JavaScript programs.

To get the SpiderMonkey JavaScript shell, see the SpiderMonkey Build Documentation or download a compiled binary for your platform from the Nightly Builds.

For a list of other JavaScript shells, see JavaScript shells.

Using the JavaScript shell

The shell offers two modes of operation. You can use it as an interactive shell, in which you type JavaScript code at a prompt and get instant gratification, which is handy for experimenting or testing new features. You can also pass in, on the command line, a JavaScript program file to run, in which case the program is run automatically.

Note: Because the JavaScript shell is used as a test environment for the JavaScript engine, the available options and built-in functions can change over time.

posted on 2011-10-13 00:58  lexus  阅读(451)  评论(0编辑  收藏  举报