Click in order · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects

Variable Declaration Order

Sort the variable declaration keywords from the least to the most restrictive:

Items to click

  • var (function scope, can be redeclared)
  • const (block scope, cannot be reassigned)
  • let (block scope, can be reassigned)
Show the answer

Correct order:

  1. var (function scope, can be redeclared)
  2. let (block scope, can be reassigned)
  3. const (block scope, cannot be reassigned)