Chapter 10: Functions Are at Your Beck and Call

Learning Objectives

  1. Understand the role of functions in making code modular and reusable
  2. Create programmer-defined functions
  3. Explain what a function is
  4. Write a function with no parameters, a single parameter, and multiple parameters
  5. Call a function, with and without parameters
  6. Understand the behavior of parameters that are not provided by the caller
  7. Use a return statement to complete execution of a function
  8. Use a return statement to provide a value to the function caller
  9. Explain what a return statement does
  10. Understand variable scope as it pertains to functions
  11. Explain what variable shadowing is
  12. Write a function that calls another function
  13. Use properly descriptive names when defining functions

Key Terminology


  1. function
  2. method
  3. indexOf
  4. encapsulation

Creating Functions

  1. TypeScript
  2. abstraction

Parameters and Variables

  1. scope