ECMAScript 2024, the latest version of ECMA International’s standard for JavaScript, has been officially approved, with features including transferring ArrayBuffers and advanced capabilities for working with string sets.
The ECMAScript 2024 specification, also generally known as ECMA-262, was approved on June 26. Among the features are added facilities for resizing and transferring ArrayBuffers and SharedArrayBuffers. ArrayBuffers have previously enabled in-memory handling of binary data. The new feature extends ArrayBuffer
constructors to take an additional maximum length that allows in-place growth and shrinking of buffers. SharedArrayBuffer
was also extended to take an additional maximum length that allows in-place growth.
Another capability featured in ECMAScript 2024 is the addition of a RegExp/v
flag for creating RexExps with more advanced features for working with sets of strings. Also introduced was the Promise.withResolvers convenience method for constructing promises. Promise.withResolvers has been described as a mechanism for managing asynchronous operations. The feature adds a static method, known as withResolvers
, to the Promise
constructor, which returns a promise along with its resolution and rejection functions conveniently exposed. ECMAScript 2024’s Object.groupBy
and Map.groupBy
methods, meanwhile, are for aggregating data. And the Atomics.waitAsync method is for asynchronously waiting for a change to shared memory. The capability is primarily for use in agents that are not allowed to block. ECMAScript 2024 also adds the String.prototype.isWellFormed
and String.prototype.toWellFormed
methods for checking and ensuring that strings contain only well-formed Unicode.