Assignment 002J

JavaScript Variables

JavaScript variables are straight forward. They are just like the variables you create in math. For example:
x = 6
Therefore 8 + x = 13
In JavaScript, first declare the variable you want to create, then assign the variable a value.
For example:
Declare these variables...
var me;
var you;
var happy;
var name;
Declaring a variables creates a "space" to store information.
Now assign values to the variables...
x = 7;
y = 9.8;
happy= true;
name = "Claudia"
Let's test the code by creating alert boxes. I'll explain alert boxes later.