W24 // FUNCTIONS: DECLARE, CALL, SCOPE
FEB 24 · Ch 10 Sec 1-3 · DUE: Refactor earlier work into functions
This week's deckPPTX
// RUN OF SHOW (8:45-10:15)
8:45
Stand-up: last week's deliverable graded, questions answered
9:20
At the keyboard: guided type-along
9:45
Build time: assignment or project work
10:10
Close: commit, push, and preview next week's reading
// THE POINT THIS WEEK
What functions are. Declaring and calling. Parameters. Scope.
// TALKING POINTS
Functions name work
- Declare once, call anywhere: function greet(name) { }
- Parameters are the slots; arguments fill them at call time
- If you typed the same lines twice, a function is begging to exist
Scope is who can see what
- Variables born in a function live and die inside it
- Outer code can't reach in; that privacy prevents chaos
- Pass data in through parameters, hand it back with return
// LINKS