ECMAScript 2019 (ES10)
ECMAScript 2019 (ES10) — ES2019 added Array.flat, flatMap, and improvements to Object and String methods. Array.prototype.flat(): Flattens nested arrays to a specified depth. Example: [1,[2,[3]]].flat(2) // [1,2,3]. Array.prototype.flatMap(): Maps each element then flattens the result. Example: ["hi", "ok"].flatMap(s => s.split("")). Object.fromEntries(): Converts key-value pairs back to an object. Example: Object.fromEntries([["a",1],["b",2]]) // {a:1,b:2}. String.prototype.trimStart(): Trims whitespace from the beginning of a string. Example: " hi".trimStart() // "hi". String.prototype.trimEnd(): Trims whitespace from the end of a string. Example: "hi ".trimEnd() // "hi". Optional catch binding: Catch error without using the parameter. Example: try { x } catch { console.log("err") }. In total, ES2019 added 8 documented features to the language. Compare with the other editions on the ECMAScript versions page.