11. More on FunctionsΒΆ

  1. 11.1. Functions as Values
    1. 11.1.1. Functions Are Data
  2. 11.2. Anonymous Functions
    1. 11.2.1. Anonymous Function Variables
    2. 11.2.2. Check Your Understanding
  3. 11.3. Passing Functions as Arguments
    1. 11.3.1. Example: setTimeout
    2. 11.3.2. Example: The Array Method map
    3. 11.3.3. Check Your Understanding
  4. 11.4. Receiving Function Arguments
    1. 11.4.1. Example: A Generic Input Validator
    2. 11.4.2. Example: A Logger
      1. 11.4.2.1. A Simple Logger
      2. 11.4.2.2. A More Complex Logger
    3. 11.4.3. A Word of Caution
  5. 11.5. Why Use Anonymous Functions?
    1. 11.5.1. Anonymous Functions Can Be Single-Use
    2. 11.5.2. Anonymous Functions Are Ubiquitous in JavaScript
    3. 11.5.3. Check Your Understanding
  6. 11.6. Recursion
    1. 11.6.1. Quick Review
      1. 11.6.1.1. Functions Can Call Other Functions
    2. 11.6.2. What Is Recursion?
  7. 11.7. Recursion Walkthrough: The Base Case
    1. 11.7.1. Joining Array Elements With a Loop
    2. 11.7.2. Bring In Recursion Concepts
    3. 11.7.3. Identifying the Base Case
    4. 11.7.4. The Case for the Base
    5. 11.7.5. Check Your Understanding
  8. 11.8. Making A Function Call Itself
    1. 11.8.1. A Visual Representation
    2. 11.8.2. A Function Calls Itself
    3. 11.8.3. Check Your Understanding
  9. 11.9. Recursion Wrap-Up
    1. 11.9.1. Recursion in a Nutshell
    2. 11.9.2. Why Do I Need To Know Recursion?
  10. 11.10. Exercises: More on Functions
    1. 11.10.1. Practice Your Skills
    2. 11.10.2. Raid a Shuttle
  11. 11.11. Studio: More Functions
    1. 11.11.1. Sort Numbers For Real
      1. 11.11.1.1. Part A: Find the Minimum Value
      2. 11.11.1.2. Part B: Create a New Sorted Array
    2. 11.11.2. More on Sorting Numbers
    3. 11.11.3. Part C: Number Sorting the Easy Way
    4. 11.11.4. So Why Write A Sorting Function?
    5. 11.11.5. Bonus Mission