ECMAScript 2021 (ES12)
ECMAScript 2021 (ES12) — ES2021 introduced logical assignment operators, numeric separators, and Promise.any. String.prototype.replaceAll(): Replaces all occurrences without needing a global regex. Example: "a-b-c".replaceAll("-", "_") // "a_b_c". Promise.any(): Resolves when the first promise fulfills. Rejects only if all reject. Example: Promise.any([p1, p2, p3]).then(first => ...). AggregateError: Represents multiple errors wrapped in a single error. Example: Promise.any([...]).catch(e => e.errors). Logical assignment operators: Combine logical operators with assignment. Example: x ??= 10; x ||= 20; x &&= 30. Numeric separators: Underscores for readability in numeric literals. Example: const billion = 1_000_000_000. WeakRef: Hold a weak reference to an object without preventing GC. Example: const ref = new WeakRef(obj). In total, ES2021 added 6 documented features to the language. Compare with the other editions on the ECMAScript versions page.