ECMAScript 2022 (ES13)
ECMAScript 2022 (ES13) — ES2022 was a major release featuring class static blocks, `.at()` method, and top-level await. Array.prototype.at(): Returns the element at a given index (supports negative indexing). Example: ["a","b","c"].at(-1) // "c". String.prototype.at(): Returns the character at a given index with negative support. Example: "hello".at(-1) // "o". Top-level await: Use await directly in module scope without async function wrapper. Example: const data = await fetch("/api/data").then(r => r.json()). Class static initialization blocks: Run static initialization logic inside class declarations. Example: class C { static { this.x = 42 } }. Error cause: Add a cause property when throwing errors for better debugging. Example: throw new Error("msg", { cause: originalError }). Object.hasOwn(): Safer alternative to hasOwnProperty() for checking own properties. Example: Object.hasOwn(obj, "prop") // true/false. In total, ES2022 added 7 documented features to the language. Compare with the other editions on the ECMAScript versions page.