Skip to content

Latest commit

 

History

History

26-scope

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Lesson 26: Scope

Where variables are visible: global, function, block.

What you'll learn

  • global scope: declared outside any function
  • function scope: visible only inside the function
  • block scope: let/const are visible only inside { }
  • inner scopes can read outer variables (lexical scope)

Example

See examples/.

Exercise

Predict what a nested-scope snippet prints.