Skip to content

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]

Lecture [15 min]

Tutorial [15 min]

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

  1. Submit Prep 6 on Gradescope. ← Due Wed at 11:59pm