Functions
A function is a reusable block of code that has a name and performs a specific task.
(Think, “Lego”.)
Flow of Control: Which statement gets executed next?
Control Structures: A) Sequence; B) Selection; C) Iteration and/or function calls.
Required Reading
- Ch. 2 Study Guide, Boolean operators (41-45)
- Logic operators and truthiness
- Ch. 3 Study Guide, Selection (69-72)
- Ch. 4 Study Guide, Functions (pp. 82-89)
- Variables
- Numbers
- Strict Mode
Examples
- Functions
- Selection
- Iteration
- Variable Hoisting Examples, pp. 92-96.
- Quiz Ninja, Ch. 3, Arrays (Github)
- Quiz Ninja, Ch. 4, Functions (Github)