1. True or False: the following are valid JavaScript statements? (Answer each)
    a. if (var == 4) { // Do something }
    False
    b. var testVar = 10;
    True
    c. if (a == b) { // Do something }
    True
    d. testVar = 10;
    True
    e. var case = “Yes”;
    False
  2. True or False: Semicolons are required to terminate every JavaScript statement.
    False
  3. Examine the following bit of JavaScript. What is the likely result?
    var orderTotal = 0;
    function collectOrder(numOrdered) {
    if (numOrdered > 0) {
    alert("You ordered " + orderTotal);
    orderTotal = numOrdered * 5;
    }
    return orderTotal;
    }

    If there has been something ordered an alert will pop up with the correct amount. Line 4 should be put after line 5 so that the correct total is displayed.
  4. From Kanye West's "Diamonds from Sierra Leone"
    You gotta love it though somebody still
    And wouldn't change by the change,
    When he came in the game,

Valid CSS!

Valid HTML 5.0