bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

ECMAScript 2025

New Features in JavaScript 2025

The

16th edition of the ECMAScript standard, released in June 2025, includes several enhancements to make JavaScript more readable and efficient.

New

Set Features in ES2025

JavaScript 2025 includes built-in methods for set operations, such as intersection(), union(), and difference(), eliminating the need for manual loops or third-party libraries.

Feature

Description union()

Returns the union of two sets intersection()

Returns the intersection of two sets difference()

Returns the difference between two sets symmetricDifference()

Returns the symmetric difference between to sets isSubsetOf() Returns true if this set is a subset of a given set isSupersetOf() Returns true if this set is a superset of a given set isDisjointFrom() Returns true if this set has no elements in in a given set

New

Iterator Helpers in ES2025

The introduction of an Iterator object provides a functional interface with lazy evaluation, allowing developers to wrap various iterators like Arrays. A new set of functional operators for iterators (like .map(), .filter(), and .take()) allows for lazy evaluation, improving performance when handling large data streams.

Function

Description drop()

Returns an iterator that skips a specified number of elements before yielding the rest every() Returns true if all elements satisfy a test function filter() Returns an iterator containing elements that satisfy a filter function find() Returns the first element that satisfies a test function flatMap() Returns an iterator by mapping each element and then flattening the results forEach() Executes a function once for each element in the iterator. from() creates an iterator object from an iterable map() Returns an iterator with all elements transformed by a map function reduce() Applies a reducer function against each element to reduce it to a single value some() Returns true if at least one element satisfy a test function take() Returns an iterator that yields a specified number of elements

Other New Features in ES2025

Feature

Description

Formula

RegExp /v flag
An "upgrade" to the /u (unicode) flag

RegExp.escape() Returns a string where regex characters are escaped

Float16Array

Formula

A Typed Array that stores 16 - bit floating - point numbers

Math.f16round()

Formula

Returns the nearest 16 - bit floating point number

Promise.try() Starts a promise chain for handling promise rejections

Import Attributes

Import attributes allowed in import statements

Warning

These features are relatively new. Older browsers may need an alternative code (Polyfill).

JavaScript Set union()

The union()

method returns the union of two sets.

The union()

method returns a new set containing the elements which are in this set, or in the argument set, or in both:

Example

const A = new Set(['a','b','c']);
const B = new Set(['b','c','d']);
const C = A.union(B);

Previous

Project - Event Listener

Next

JavaScript Error Statements