09 Jul

ECMAScript 2024 JavaScript Standard Receives Approval

    The ECMAScript 2024 standard has been officially sanctioned, introducing new capabilities for handling ArrayBuffers and enhanced tools for working with string sets and constructing promises.

     

    On June 26, ECMA International approved ECMAScript 2024, the latest update to the JavaScript specification, also referred to as ECMA-262. This release includes new features for resizing and transferring ArrayBuffers and SharedArrayBuffers. ArrayBuffers, traditionally used for in-memory binary data manipulation, now have constructors that support an additional maximum length, enabling buffers to grow or shrink in place. Similarly, SharedArrayBuffer has been updated to allow for in-place size adjustments.

    One notable addition in ECMAScript 2024 is the RegExp/v flag, which provides more sophisticated methods for working with sets of strings. Additionally, the new Promise.withResolvers method simplifies the creation and management of promises. This feature introduces a static method to the Promise constructor that returns a promise alongside its resolution and rejection functions, facilitating asynchronous operations.

    Other enhancements in ECMAScript 2024 include Object.groupBy and Map.groupBy methods, which are designed for data aggregation. The Atomics.waitAsync method enables asynchronous waiting for changes in shared memory, particularly useful for agents that cannot block. Furthermore, the String.prototype.isWellFormed and String.prototype.toWellFormed methods have been added to verify and ensure that strings contain only well-formed Unicode characters.

    ECMAScript, while rooted in JavaScript, also incorporates elements from Microsoft’s JScript, a legacy ECMAScript dialect. Some features proposed for ECMAScript 2024 did not make the final cut but are potential candidates for ECMAScript 2025. These include duplicate named capturing groups in regular expressions and new methods for JavaScript’s Set class, such as union and intersection. Last year’s ECMAScript 2023 update introduced array search and modification methods and expanded the WeakMap API.

    Share this