JavaScript Sort of
We will be playing with a modified version of JavaScript in these pages.
1. First Code Example - Print
Here is code which calls the "print" function. Click the Run button below, and your computer will run this code, and the output of the code will appear to the right.
|
2. Print String
|
3. Print Variables
|
4. Code Example - The Curse
Change the code below so it produces the following output. Use a variable to store the string "Alice" in a variable on the first line like x = "Alice";
, then use the variable x on the later lines. In this way, changing just the first line to use the value "Bob" or "Zoe" or whatever changes the output of the whole program.
Alice Alice Alice Alice In high school I had a crush on Alice Now the Alice curse is lifted
|