W21 // ARRAYS
FEB 3 · Ch 9 Sec 1-4 · DUE: Array exercises
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
Why data structures. Arrays, operations, looping arrays.
// TALKING POINTS
Arrays hold many
- An array is an ordered list in one variable
- Index 0 is the first seat on the bus; length is the seat count
- push adds to the end, pop removes from it
Looping the list
- for (let i = 0; i < arr.length; i++) visits every index
- The loop variable is the index; arr[i] is the passenger
- Off-by-one errors live at the fence posts: check 0 and length-1
// LINKS