Getting started

What you need

You’ll need on your machine

  1. A JavaScript interpreter which provides a command line
  2. An editor on your machine.

You’ll also to download and unzip the course work folder.

Windows and Linux

For Windows the easiest thing to do is to download the JSDB interpreter, and use notepad (or some other editor).

For Linux you and install Rhino and use your favourite editor.

$ sudo apt-get install rhino

Are you ready?

You’ll want to be able to run the JavaScript interpreter from the command line when in the work folder. This will be automatic (via the PATH) with Linux and Rhino. For Windows the easiest thing to do is to place the jsdb.exe file in the work folder.

When you’re ready type js at a command prompt. This starts the interpreter and gives you a js> prompt. You’ll get something like this.

core-javascript-work$ js
Rhino 1.7 release 2 2010 01 20

Now type the command as below at the JavaScript prompt (with Return at the end of each line) and you’ll get responses as below.

js> a = '0'
js> b = 0
js> c = ''

js> a == b
js> b == c
js> a == c

You might be surprised by the last response from the interpreter, but every JavaScript interpreter does this.

Yes, you’re ready

To exit the interpreter use Ctrl-C or Ctrl-D.