Formally introduced in ES6, const
was introduced in JavaScript 1.5 and was a Mozilla-specific extension and not part of ECMAScript 5.
Unfortunately, support cannot be retrofitted to older browsers with a polyfill, supported by IE11+, Edge 12+, Firefox 36+, Chrome 21+, Safari 5.1+. If you still need to support older browsers or devices you may want to stick with var
.
NOTE: some initial implementations may have thrown different exceptions on reassignment, were not limited in scope, or treated const
like ‘var
‘.
Name may start with letter, underscore or $ character.
REFERENCES: