WPDD

WordPress Develop & Design

Block-Scoped Variables: let and const

let

  • Usage: Used to declare variables that can be reassigned.
  • Scope: Block-scoped (i.e., limited to the block, statement, or expression in which it’s used).

const

  • Usage: Used to declare variables that cannot be reassigned.
  • Scope: Also block-scoped.