To Notes

IT 130 -- 10/21/08

 

Review Questions

  1. Name two places where JavaScript statements can be placed.

    Ans: (1) In an onclick attribute, (2) within script tags in the head or body.

  2. What is an event handler?

    Ans: It is a function that is called in an onclick statement.

  3. What would be printed in the browser?

    Ans: Play it again sam.

  4. Name four types of literals in JavaScript.

    Ans: Integer (e.g., 3465), floating point (e.g., 3.14159), string (e.g., "Hello") boolean (true or false).

  5. What does variable initialization mean?

    Ans: It means declaring and assigning a value to a variable in one statement like this:
    var x = 5;.

  6. Which of these are legal JavaScript variable names?
  7. What does camel casing mean?

    Ans: Each new word within a variable name is spelled in upper case.

  8. Give five JavaScript operators.

    Ans: + (addition or concatenation)  -  *  /  =

  9. What does "concatenation" mean?

    Ans: To put two character strings together to make one longer string.

  10. What is the output of these JavaScript statements?

    Output:
  11. This example has intentional errors. Find as many of them as you can:

    When you get stuck, read the next section on debugging with Mozilla. Use Mozilla to find the rest of the errors.

    Ans: See the Distance2 Example

 

Debugging with Mozilla Firefox

 

Project Proj4