Which statement correctly describes the let keyword compared to var?

JavaScript Associate Easy

JavaScript Associate — Easy

Which statement correctly describes the let keyword compared to var?

Key points

  • let is block-scoped, var is function-scoped
  • let is not hoisted to a usable state, var is hoisted with undefined
  • let variables have a temporal dead zone
  • var variables can be accessed before their declaration

Ready to go further?

Related questions