Skip to content

Mar 11: Functions and Scope

Learning Objectives

After today's class, you should be able to:

  • Explain how function and variable declarations are hoisted to the top of their scope.
  • Compare function declarations (which are fully hoisted) and function expressions.
  • Distinguish between global, function/local, and block scope of variable declarations.

Lesson Outline

Mini Lecture [30 min]

Peer Review [45 min]

  • Read and discuss narrative/sketch – 8 min/project
    • 2:55–3:03pm   Review 1st project
    • 3:03–3:11pm   Review 2nd project
  • Meet other team and give feedback – 4 min/each
    • 3:11–3:19pm   1 and 4    2 and 5    3 and 6
    • 3:19–3:27pm   4 and 7    5 and 8    6 and 9
    • 3:27–3:35pm   7 and 1    8 and 2    9 and 3

Seating Chart

Whiteboard
Team 9
reviews 3 and 6
Team 8
reviews 2 and 5
Team 7
reviews 1 and 4
Team 6
reviews 9 and 3
Team 5
reviews 8 and 2
Team 4
reviews 7 and 1
Team 3
reviews 6 and 9
Team 2
reviews 5 and 8
Team 1
reviews 4 and 7
Back Wall