JS - Functions
Functions are reusable blocks of code. This section connects basic functions with callbacks and closure.
Core Notes
- Functions declaration
- function expressions
- arrow functions
- callbacks
- Closure in JS
- setTimeout() setInterval()
Mental Model
| Concept | Key idea |
|---|---|
| function declaration | named reusable function |
| function expression | function stored in a variable |
| arrow function | shorter syntax, different this behavior |
| callback | function passed into another function |
| closure | function remembers outer scope |