Programming · Flashcard

Which keyword declares a variable whose binding cannot be reassigned?

  • Aconst — it creates a binding that cannot be reassigned after initialization
  • Blet — it creates a binding that can be freely reassigned at any time
  • Cvar — it declares a function-scoped binding that can be reassigned
  • Dstatic — it declares a fixed binding shared across every program scope

Why this is the answer

const creates a binding that can't be reassigned after initialization. let allows reassignment, var is a reassignable function-scoped declaration, and static isn't a JavaScript variable keyword at all (it only marks class members).

Official docs
Study in Gnoseed →