tutorial 2: declaring variables and assigning values

watch it on YouTube

Resource

starting template - download and open in Notepad or view the source code and copy into a new file to save as an HTML file.

JavaScript Commands

var
declares variables
=
assignment operator; used in expressions and to assign values to variables
alert();
command that generates a popup alert box. Pass a variable or value as a parameter. The value passed to the function will display in the popup alert box.
+ - * /
operators. These function as you would expect mathematically and should be used with numeric values.
x = y + z;
example of an expression