Logical assignmentsBaseline · Widely available
The logical AND assignment (&&=) and the logical OR assignment (||=) operators short-circuit the respective binary logical operators.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 16, 2020. Widely available since Mar 16, 2023.
Browser support
DesktopChrome
1–84Not supported
85+Supportedsince Aug 25, 2020
Current: 155Edge
12–84Not supported
85+Supportedsince Aug 27, 2020
Current: 154Firefox
1–78Not supported
79+Supportedsince Jul 28, 2020
Current: 157Safari
1–13.1Not supported
14+Supportedsince Sep 16, 2020
Current: 27MobileChrome Android
18–84Not supported
85+Supportedsince Aug 25, 2020
Current: 155Firefox Android
4–68Not supported
79+Supportedsince Jul 28, 2020
Current: 157Safari iOS
1–13.4Not supported
14+Supportedsince Sep 16, 2020
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Logical AND assignment.
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.
Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| logical_and_assignment | 85 | 85 | 79 | 14 | 85 | 79 | 14 |
| logical_or_assignment | 85 | 85 | 79 | 14 | 85 | 79 | 14 |