The ECMAScript 2024 specification includes a new feature for transferring ArrayBuffers and advanced capabilities for working with string sets and constructing promises. Credit: PanuShot/Shutterstock 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. In addition to being based on JavaScript, ECMAScript also is based on Microsoft’s JScript, described as a legacy dialect of the ECMAScript standard. Some features that did not make it into ECMAScript 2024 are still contenders for ECMAScript 2025 next year. These include duplicate named capturing groups, for regex capturing groups to be repeated, and new Set methods in JavaScript, to add methods like union and intersection to JavaScript’s built-in Set class. Last year’s ECMAScript 2023 specification offered methods for searching and changing arrays and extended the WeakMap API. Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos