CIT597 Quiz 4
Fall, 2002
  1. Name the three primitive types in JavaScript.

  2. Under what conditions will a==b be true but a===b be false?

  3. If param="x" and expr="x*x", use these variables to create a function named square that returns the square of its argument.

  4. In JavaScript, functions are "first class objects." Briefly mention two things that you can do with functions as a consequence of this fact.

  5. Does the declaration  var a  declare a local or a global variable?

  6. True or false:
    1. Every variable is a property of an object

    2. Every object belongs to a class.

    3. Every class has a prototype.

    4. JavaScript has a "wrapper class" for every primitive type.

    5. A method is a property whose value is a function.
    1. You can attach properties to a function.

    2. Within a method, this and callee refer to the same object.

    3. When embedded in HTML, JavaScript is not case sensitive.

    4. Anonymous functions cannot be recursive.

    5. Functions may be declared within other functions.
  7. What are the two possible values for the action attribute of the HTML form tag?

  8. Write the JavaScript to do each of the following:
    1. Assuming that x and y are variables, put the sum x+y into the HTML document.

    2. Load a new URL, given by the variable url, into the window.

    3. In an HTML button, put up an alert box when the user clicks the button.