test.js

Fri, 15 Oct 2010 15:17:17 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 15 Oct 2010 15:17:17 +0100
changeset 0
b2e55f320d48
permissions
-rw-r--r--

Initial commit

0
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 function hello(i)
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 {
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 var foo = i;
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 if(foo == 1)
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 return "Hello world! " + foo;
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 else if(foo == 2)
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 return "Haha!";
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 else
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 return "Goodbye!";
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 }
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 print(hello(1));
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 print(hello(2));
b2e55f320d48 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 print(hello(3));

mercurial