Week 5 Outline

  • Abstraction and Predefined Functions
  • Here's a simple page that uses a predefined square-root function. Here's a reference to predefined functions (look under JavaScript Math Objects and Javascript Global Properties and Functions for the most common functions).

    Dave Reed has created a library of useful random functions. Here is one example that uses the random functions. Here's a link to these functions.

  • Creating Your Own Functions
  • Function page created in class

    Functions that are called as part of an expression should have a return value. Functions that are called by a user event (button press) should not have a return value. A more comprehensive reference to functions can be found online.

    Function concepts and terms you should know:

    • argument and parameter
    • local variable
    • return value
    • using functions as abstractions
  • Midterm exam is next Wednesday (October 19)