Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Lesson 07: Variables: let, const, var

Declaring values. Prefer const; use let when reassigning; avoid var.

What you'll learn

  • const — can't be reassigned (but objects are still mutable)
  • let — block-scoped, reassignable
  • var — function-scoped, hoisted, legacy — avoid in new code
  • declare close to first use; one declaration per concept

Example

See examples/.

Exercise

Convert a var-heavy snippet to const/let.