JavaScript Variables and Data Types Worksheet

Question 1

Find a reference that lists all the keywords in the JavaScript programming language.

JavaScript
Question 2

True or false: keywords are NOT case sensitive.

false
Question 3

There are some rules for how you can name variables in JavaScript. What are they?

The name of a variable must begin with a letter,dollar sigh or an underscore, must NOT start with a number. Do not use dash or period in a variable name. Can not use keywords or reserved words. Variables are case sensitive. Use a name the describes the informtion in the variable. Use camel case.
Question 4

What is 'camelCase'?

camelCase is writing phrases without spaces or punctuation and with capitalized words.
Question 5

What are ALL the different data types in JavaScript (note that there are some that we did not discuss in class)?

boolean,string,number.
Question 6

What is the assignment operator and why do they call it 'assignment'?

Replace this text with the solution to the above question/problem.
Question 7

What is a boolean data type?

True or false.
Question 8

What happens if you forget to put quotes around a string when you initialize a variable to a string? How does JavaScript try to interperet this?
For example: var lastName = Jones;

JavaScript thinks it is a number.
Question 9

What character is used to end a statement in JavaScript?

the semicolon
Question 10

If you declare a variable, but do not initialize it, what value will that variable store?

It will store nothing/Undeclared.

Coding Problems

Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.

Here are some tips to help you with the coding problems: