console.log("Hello from the demo");
for(var i=1;i<9;i++) {
console.log("I is ", i);
if (i%2 == 0) {
console.log(i, "is even");
}
switch(i) {
case 1: console.log("one"); break;
case 2: console.log("two"); break;
case 3: console.log("three"); break;
case 4: console.log("four"); break;
case 5:
case 6: console.log("five or six"); break;
default:
console.log("too high");
}
}
i = 3;
while (i < 5) {
console.log("in while i=",i);
i+=1;
}
i = 10;
do {
console.log("in do while i=",--i);
} while (i > 5);
remember to press ctrl-shift-j