Feb 24: Scope & Closures
Learning Objectives
After today’s class, you should be able to:
- Identify a variable’s lexical scope (global, function, block).
- Define and give a concrete example of a closure in JavaScript.
- Name and describe three Web APIs you can use in your project.
Lesson Outline
Debrief [5 min]
- Lab 5 solution – see Canvas Files
Lecture [15 min]
- Chapter 8: Slides 61–65
- capture-bubble.html
Tutorial [15 min]
- Install VS Code extensions
- Basic Syntax
AI Survey [20 min]
- Link announced in class
- Discussion about AI tools
Explore [20 min]
- Web APIs – for example:
- DOM, Fetch, Geolocation, Web Speech, Web Storage
Before Thursday
- Submit Prep 6 on Gradescope. ← Due Wed at 11:59pm