Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Can I create javascript shell scripts?</p> </blockquote> <p>You bet!</p> <ul> <li>On Windows, you can do this by using <code>cscript.exe</code> (you can even set up a file extension -- I use <code>jx</code> -- that automatically runs when you just double-click the filename or use it as a command in a shell: Just associate that file extension with the command <code>"c:\WINDOWS\system32\cscript.exe" /e:JavaScript /nologo "%1" %*</code>). This is (and I've measured carefully) about 80 milion times better than fighting with Windows' batch language. About. (And if you don't want to use JScript&nbsp;&mdash; Microsoft's variant of JavaScript&nbsp;&mdash; you even have options, see below.)</li> <li>On *nix, a shell script can be set to run in any installed interpreter (that's what the <code>#!...</code> line at the top is telling the command interpreter). I expect you'll find a few if you search around.</li> <li>On the Mac, you probably have <a href="http://en.wikipedia.org/wiki/WebKit#JavaScriptCore" rel="nofollow noreferrer">JavaScriptCore</a> installed in <code>/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc</code></li> <li>And on all of the above, if you like, you can install <a href="http://www.mozilla.org/rhino/" rel="nofollow noreferrer">Rhino</a> and Java and get platform independence and access to a huge range of library functionality. Rhino has a built-in shell, or you can tell it to execute a specific JavaScript file. It interoperates with Java, so if you do this, you have <em>easy</em> access to all essentially of the functionality available to Java.</li> </ul> <blockquote> <p>Where is javascript commonly used beside the web browsers?</p> </blockquote> <p>I use it for shell scripting on Windows. I also use it as a server-side language, for instance in the server-side part of a web application. It's also used in other environments where a lightweight, powerful scripting language is useful, such as in the <a href="http://www.mongodb.org/display/DOCS/Home" rel="nofollow noreferrer">MongoDB</a> shell environment (you can use it to query MongoDB data) and stored procedures.</p> <p>All of that said, writing a browser-based project is a rich, interactive way to learn the language.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload