Variables (const, let)

In JavaScript, const declares a variable that cannot be reassigned, and let a reassignable variable, both block-scoped. A const holding an object or an array can nevertheless have its contents modified. Prefer const by default and avoid var.

Example

const taux = 0.2
let total = 0
total += 10

Related concepts

The whole glossary