Let and constBaseline · Widely available
The let and const declarations define block-scoped variables.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 20, 2016. Widely available since Mar 20, 2019.
Browser support
DesktopChrome
1–48Not supported
49+Supportedsince Mar 2, 2016
Current: 155Edge
12–13Not supported
14+Supportedsince Aug 2, 2016
Current: 154Firefox
1–43Not supported
44+Supportedsince Jan 26, 2016
Current: 157Safari
1–9.1Not supported
10+Supportedsince Sep 20, 2016
Current: 27MobileChrome Android
18–48Not supported
49+Supportedsince Mar 9, 2016
Current: 155Firefox Android
4–43Not supported
44+Supportedsince Jan 26, 2016
Current: 157Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: const.
Feature detection
JS · check before using
// Syntax can't be tested with an if-statement — an unsupported
// browser fails to parse the whole script. Either transpile for older
// targets (e.g. Babel/TypeScript/esbuild), or probe in isolation:
let supported = true;
try {
new Function("/* code that uses the syntax */");
} catch {
supported = false;
}This is a language syntax feature.
Specification
Usage share
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.