coderef

Template literalsBaseline · Widely available

Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–61Not supported
62+Supportedsince Oct 17, 2017
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–52Not supported
53+Supportedsince Apr 19, 2017
Current: 157
Safari
1–10.1Not supported
11+Supportedsince Sep 19, 2017
Current: 27
MobileChrome Android
18–61Not supported
62+Supportedsince Oct 24, 2017
Current: 155
Firefox Android
4–52Not supported
53+Supportedsince Apr 19, 2017
Current: 157
Safari iOS
1–10.3Not supported
11+Supportedsince Sep 19, 2017
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Template literals.

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.

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
template_literals411234941349
template_literals.template_literal_revision62795311625311