🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket
Back

Security News

ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More

ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.

ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More

Sarah Gooding

June 26, 2025

The ECMAScript 2025 specification (16th edition of ECMA-262) has been officially approved by the Ecma General Assembly during its 129th meeting in Geneva on June 25, 2025. Shared by TC39 co-chair Rob Palmer on Bluesky, this milestone finalizes the language updates curated by TC39 and signals what’s next for the JavaScript ecosystem.

JavaScript evolves through a formal process led by TC39, a technical committee under Ecma International that reviews, debates, and stages proposals before they become part of the official language spec. Once a set of features reaches Stage 4, meaning they’ve been implemented in two major engines and pass thorough review, they’re eligible for inclusion in the next edition of ECMAScript, the standardized version of JavaScript.

We’ve covered parts of this process in past posts, including Iterator Helpers reaching Stage 4, the standardization of JSON Modules and Import Attributes, and the addition of features like Promise.try, RegExp.escape, and Float16Array. Since ECMAScript 2016, the spec has followed a steady annual release cycle, with a new edition published every June.

Language Enhancements in ES2025#

Here’s a closer look at what made the cut for the most recent update to the spec:

  • Duplicate Named Capture Groups
    Regular expressions now support reusing named capture groups, handy for cleaner and more modular pattern matching.
  • Float16Array
    Adds support for 16-bit floating-point typed arrays, allowing more efficient memory usage for machine learning, graphics, and other high-performance applications.
  • Import Attributes
    A major improvement to the module system: import statements can now include additional metadata via attributes. This is especially relevant for things like module types (type: "json", etc.) and bundler/runtime optimizations.
  • Iterator Helpers
    This introduces a rich set of functional utilities (like .map(), .filter(), .take(), etc.) directly on iterators, bringing long-awaited parity with array methods and enabling more expressive lazy evaluation.
  • JSON Modules
    Native support for importing .json files as modules. No more custom loaders. This makes server and toolchain code cleaner and simpler.
  • Promise.try
    A small ergonomic win: Promise.try(fn) executes fn and wraps any synchronous errors in a rejected promise. It’s a pattern that’s already widely used in async codebases via utility libraries like Bluebird, now standardized.
  • RegExp.escape
    Safely escape strings to be used in regular expressions, a long-standing request that removes the need for third-party utilities.
  • RegExp Modifiers
    Separates RegExp flags into a .modifiers property for improved introspection and manipulation.
  • Set Methods
    Adds long-awaited methods to Set.prototype: union, intersection, difference, and symmetricDifference. These mirror mathematical set operations and reduce the need for manual iteration or third-party libs.

Many of the ECMAScript 2025 features are already implemented, or partially available, in engines like V8, often behind flags. Some, like Iterator Helpers, are supported in environments such as Deno, or can be polyfilled. For testing and experimentation, transpilers like Babel (as support lands) are good places to try them out.

The final spec is available here: https://tc39.es/ecma262/ and a printable PDF is also available for download.

TC39 notes that the HTML version is the normative copy. (If there's ever a conflict between formats, the HTML defines the official behavior. The PDF is provided for convenience but isn't authoritative.) TC39 recommends reporting issues only if they persist in the latest draft.

Subscribe to our newsletter

Get notified when we publish new security blog posts!

Try it now

Ready to block malicious and vulnerable dependencies?

Install GitHub AppBook a Demo

Related posts

Back to all posts