JavaScript keeps evolving, and 2025 is shaping up to be an exciting year! ๐ Whether you're a frontend developer, full-stack engineer, or just a language nerd, these upcoming ECMAScript features are worth keeping an eye on.
Here are 7 upcoming JavaScript features that are either in Stage 3 or getting closeโmeaning they're likely to become part of the language very soon.
1. ๐ Pipeline Operator (|>
)
Imagine chaining functions like a Unix pipe:
const double = x => x * 2;
const square = x => x * x;
let value = 5
const result = value
|> double // 5 * 2 = 10
|> square // 10 * 10 = 100
|> String; // convert 100 into String "100"
the code flows from left to right.
the same above code we write like this in javascript as of now
const result = String(square(double(value)));
โ
Cleaner than nested function calls
๐ง Stage: 2/3 (depends on proposal version)
๐ Proposal: https://github.com/tc39/proposal-pipeline-operator
2. ๐งฉ Pattern Matching (Like switch on steroids)
Pattern matching is a way to compare a value (like an object) against several shapes or patterns โ and run different code depending on what pattern it matches:
match (input) {
{ type: "success", data } => handleSuccess(data),
{ type: "error", message } => handleError(message),
_ => handleUnknown()
}
the above code work like this:- lets say you have an object
called input
. This match blocks which satisfy the criteria.
If input
is an object like {type:"success", data:...}
it will call the handleSuccess
with data
.
if nothing is matched it will call handleUnknown
.
โ
Great for handling JSON APIs or discriminated unions
๐ง Stage: 3
๐ Proposal: https://github.com/tc39/proposal-pattern-matching
3. ๐ Built-in Observable
JavaScript may soon include a native Observable (finally!) to work better with reactive programming:
An Observable is a way to handle streams of data over time โ like events, user inputs, or async data โ in a clean, reactive way.
const obs = new Observable((subscriber) => {
subscriber.next("Hello");
subscriber.complete();
});
Whatโs going on in above code:
new Observable(...)
creates a new stream of data.
The function you pass gets a subscriber object.
You call subscriber.next(value)
to send a value ("Hello") to whoever is listening.
You call subscriber.complete()
to say "Iโm done sending values."
โ
Works well with reactive UI frameworks
๐ง Stage: 1 (early, but gaining traction)
๐ Proposal: https://github.com/tc39/proposal-observable
4. ๐ฆ Records and Tuples (Immutable Data Structures)
JavaScript is introducing Records and Tuples โ new data structures that provide deep immutability and value-based equality.
What are Records and Tuples?
- Records are like immutable objects: once created, their properties cannot be changed.
- Tuples are like immutable arrays: once created, their elements cannot be changed.
This means you can safely share these data structures across your app without worrying about accidental changes.
Why use them?
- Deep immutability: The data cannot be altered anywhere.
-
Value equality: Two Records or Tuples with the same content are considered equal (
===
), unlike normal objects or arrays. - This makes comparisons and caching much simpler and more predictable.
Syntax Examples
const person = #{ name: "Alice", age: 30 }; // Record
const point = #[10, 20]; // Tuple
The #{ ... } syntax creates a Record.
The #[ ... ] syntax creates a Tuple.
โ
Useful for safer data structures
๐ง Stage: 2
๐ Proposal: https://github.com/tc39/proposal-record-tuple
5. ๐๏ธ Array Grouping
Quickly group items by a property:
const grouped = Object.groupBy(users, user => user.role);
โ
Simplifies data transformation
๐ง Stage: 3
๐ Proposal: https://github.com/tc39/proposal-array-grouping
6. โฑ๏ธ Temporal API (Better Dates and Times)
JavaScript is introducing the Temporal API, a modern and much-improved way to handle dates and times โ designed to fix the many problems with the old Date
object.
Why use Temporal?
- More precise and reliable handling of time zones, calendars, and formatting.
- Immutable objects that avoid the quirks and bugs of
Date
. - Clearer APIs for common date and time operations.
Example usage:
const now = Temporal.Now.instant(); // current precise timestamp
const birthday = Temporal.PlainDate.from("1995-08-03"); // a date without time
What do these do?
Temporal.Now.instant() gives you the current moment in time with nanosecond precision.
Temporal.PlainDate.from() creates a date-only object (no time or timezone), great for birthdays or anniversaries.
โ
Handles time zones, durations, calendars
๐ง Stage: 3
๐ Proposal: https://github.com/tc39/proposal-temporal
7. ๐ Set Methods: .union()
, .intersection()
, .difference()
JavaScript is finally adding built-in methods for common set operations โ making it easier to work with sets directly!
What are these methods?
-
.union()
โ Combines two sets, returning a new set with all unique elements from both. -
.intersection()
โ Returns a new set with only the elements common to both sets. -
.difference()
โ Returns a new set with elements in the first set but not in the second.
Example:
const a = new Set([1, 2, 3]);
const b = new Set([3, 4, 5]);
console.log(a.union(b)); // Set {1, 2, 3, 4, 5}
console.log(a.intersection(b)); // Set {3}
console.log(a.difference(b)); // Set {1, 2}
โ
Native, readable, and efficient
๐ง Stage: 3
๐ Proposal: https://github.com/tc39/proposal-set-methods
โจ Final Thoughts
JavaScript is evolving fast. Staying aware of whatโs coming helps you write future-ready code and adopt new patterns early.
Top comments (1)
Ah, I see JavaScript finally decided to peek over at PHPโs notebookโฆ classic case of "if you can't reinvent it, just borrow it!"