VARIABLES FOR NUMBERS
Assignment # 3
JAVASCRIPT
VARIABLES FOR NUMBERS | JAVASCRIPT
1. Declare a variable called age & assign to it your age. Show
your age in an alert box.
2. Declare & initialize a variable to keep track of how many
times a visitor has visited a web page. Show his/her
number of visits on your web page. For example: “You
have visited this site N times”.
3. Declare a variable called birthYear & assign to it your
birth year. Show the following message in your browser:
Page 1 of 3
VARIABLES FOR NUMBERS | JAVASCRIPT
4. A visitor visits an online clothing store
www.xyzClothing.com . Write a script to store in variables
the following information:
a. Visitor’s name
b. Product title
c. Quantity i.e. how many products a visitor wants to
order
Show the following message in your browser: “John
Doe ordered 5 T-shirt(s) on XYZ Clothing store”.
Page 2 of 3
VARIABLES FOR NUMBERS | JAVASCRIPT
-- END --
Page 3 of 3