DEV Community

Cover image for 16 Modern JavaScript Features That Might Blow Your Mind
Sylwia Laskowska
Sylwia Laskowska

Posted on

16 Modern JavaScript Features That Might Blow Your Mind

Ah, what a time to be alive!
As usual, I’ve taken way too much on my plate — there were just too many things that looked interesting 😄 Right now I feel like I have ten parallel storylines running in my life and not enough hands to handle them all.

But let’s be honest — I’m not going to skip my weekly post.
That said… this time I won’t dare to go for a deep dive again. Let’s keep it lighter 😉

Some time ago, one of my posts got surprisingly popular:
Stop Installing Libraries: 10 Browser APIs That Already Solve Your Problems

Apparently, these kinds of curated lists are something the community really needs.

Sure, we have documentation. Sure, we can Google everything — or ask Claude, GPT or Gemini. But there’s one small problem: before you can search for something, you first need to know that it exists.

So this time I decided to go through a handful of newer additions to the ECMAScript standard — features that landed in recent years and are already available in modern environments.

This topic isn’t new to me. Back in 2019, I gave a talk at meet.js Summit called “Beyond ES6 — What Comes After the Hype?” (or something along those lines 😄). If for some reason you’d like to revisit ECMAScript features from 2015–2019, you can probably still find the recording somewhere on YouTube.

Alright, enough intro.

Below you’ll find some of my favorite modern JavaScript features from recent years. I’m not listing everything — only the ones that feel practical, interesting, or quietly powerful.

And as you’ll see… they all connect into a bigger pattern.


📅 ES2022 — The Foundation of Modern JS

✨ Top-Level await

What problem it solves:
A nice quality-of-life improvement. Before this, you couldn’t use await directly at the top level of a module. You had to wrap everything inside an async function just to load config or initialize data. Not the worst thing ever — but honestly a bit pointless.

Old way (extra boilerplate):

async function init() {
  const config = await fetchConfig();
  startApp(config);
}
init();
Enter fullscreen mode Exit fullscreen mode

Now:

const config = await fetchConfig();
startApp(config);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Cleaner startup logic, less ceremony, easier reading.


🔒 Private Class Fields (#)

What problem it solves:
Let’s be honest — JavaScript never really had private class fields. We just pretended it did, creating weird conventions like _privateVar, which wasn’t private at all 😉 (well… unless you were using TypeScript).

Now:

class User {
  #id;

  constructor(id) {
    this.#id = id;
  }
}
Enter fullscreen mode Exit fullscreen mode

Trying to access user.#id outside the class throws an error.

Why it matters:
Real encapsulation. Safer abstractions and fewer accidental modifications.


🧠 Error.cause

What problem it solves:
How many times have you lost half a day debugging because one error triggered another, but the connection between them was almost impossible to trace?

Old way: overwrite the error or manually attach metadata.

Now:

throw new Error("Failed to load data", {
  cause: originalError
});
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Better debugging and logging. You can track the full chain of failures instead of guessing.


🎯 Object.hasOwn()

What problem it solves:
Back in the day, checking if an object really had a property required creating this confusing monster:

Old way:

Object.prototype.hasOwnProperty.call(obj, "key");
Enter fullscreen mode Exit fullscreen mode

Now:

Object.hasOwn(obj, "key");
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Cleaner syntax, easier to read, fewer edge-case surprises.


📍 .at() — Relative Indexing

What problem it solves:
Classic junior interview question: how do you get the last element of an array? Everyone above junior level eventually learned the same ugly hack.

Old way:

arr[arr.length - 1];
Enter fullscreen mode Exit fullscreen mode

Now:

arr.at(-1);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Maybe not revolutionary, but definitely clearer and more readable.


📅 ES2023 — The Immutability Upgrade

This release focuses on one big idea: avoid accidental mutation.


🧹 toSorted()

Problem:
Array.sort() is great… except it mutates the original array. Someone forgets that — and suddenly half your app is broken. Others remember, so they manually clone arrays every time.

Old workaround:

[...arr].sort();
Enter fullscreen mode Exit fullscreen mode

Now:

const sorted = arr.toSorted();
Enter fullscreen mode Exit fullscreen mode

What it changes:
You get a sorted copy without touching the original data.

Why it matters:
Huge for state management and functional-style code.


🔁 toReversed() & toSpliced()

Same philosophy: copy instead of mutate.

arr.toReversed();
arr.toSpliced(2, 1);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Predictability. You don’t accidentally break code sharing the same array reference.


🔎 findLast() / findLastIndex()

Problem:
We had find, but what if you wanted the last matching element? The old workaround was… not exactly pretty, and definitely confusing for juniors.

Old way:

[...arr].reverse().find(fn);
Enter fullscreen mode Exit fullscreen mode

Now:

arr.findLast(fn);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Less noise, clearer intent — the code says exactly what you mean.


📅 ES2024 — Data Transformation & Async Control

🧩 Object.groupBy()

Problem:
Grouping arrays usually meant writing reducers that looked more complex than the problem itself.

Old way:

users.reduce((acc, user) => {
  (acc[user.role] ??= []).push(user);
  return acc;
}, {});
Enter fullscreen mode Exit fullscreen mode

Now:

const grouped = Object.groupBy(users, u => u.role);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Massive readability upgrade. What used to be a helper function is now a one-liner.


Promise.withResolvers()

Problem:
Creating external resolve / reject handlers was always awkward.

Old way:

let resolve;
const promise = new Promise(r => resolve = r);
Enter fullscreen mode Exit fullscreen mode

Now:

const { promise, resolve, reject } =
  Promise.withResolvers();
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Cleaner async orchestration — especially for queues, events, or complex flows.


📦 Resizable ArrayBuffer

Problem:
Buffers used to have fixed sizes, which was frustrating when working with streaming or dynamic data — especially if you were one of those weirdos (like me 😄) experimenting with edge JavaScript, workers, or binary data.

const buffer = new ArrayBuffer(8, {
  maxByteLength: 16
});
Enter fullscreen mode Exit fullscreen mode

Why it matters:
More flexible memory handling for advanced scenarios.


📅 ES2025 — Functional JavaScript Gets Serious

🧠 Iterator Helpers

Problem:
Array methods are great — but they create intermediate arrays at each step. Sometimes that’s unnecessary work.

Old way (creates extra arrays):

const result = arr
  .map(x => x * 2)
  .filter(x => x > 5)
  .slice(0, 3);
Enter fullscreen mode Exit fullscreen mode

Each step allocates a new array.

Now (lazy processing):

const result = iterator
  .map(x => x * 2)
  .filter(x => x > 5)
  .take(3)
  .toArray();
Enter fullscreen mode Exit fullscreen mode

What it replaces:
Manual generator pipelines or performance-heavy array chains.

Why it matters:

  • values are processed step by step (lazy evaluation)
  • fewer allocations
  • better performance on large datasets
  • more functional-style pipelines

Think: streaming mindset instead of “build another array”.


🧩 New Set Methods

Problem:
More advanced set logic always required custom helpers or awkward conversions to arrays.

Old way:

const intersection = new Set(
  [...a].filter(x => b.has(x))
);
Enter fullscreen mode Exit fullscreen mode

Now:

a.intersection(b);
a.union(b);
a.difference(b);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Math-like operations directly in the language. Less boilerplate, clearer intent.


🔐 RegExp.escape()

Problem:
Security. Building regular expressions from user input could easily break the pattern or even introduce vulnerabilities.

Old way:

const safe = userInput.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const regex = new RegExp(safe);
Enter fullscreen mode Exit fullscreen mode

Now:

const regex = new RegExp(RegExp.escape(userInput));
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Safer regex creation without writing your own helper every time.


Promise.try()

Problem:
Sometimes you want to treat sync and async code the same way — especially when a sync function might throw.

Now:

await Promise.try(() => mightThrow());
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Everything becomes promise-based automatically, which simplifies error handling pipelines.


🧊 Float16 Support

JavaScript has always been a bit awkward with numbers — the default is 64-bit floating point. We’ve had Float32Array for a while, which was already useful, but now JS goes one step further.

const data = new Float16Array(1024);
Enter fullscreen mode Exit fullscreen mode

What this actually means:

  • smaller numeric representation (16-bit)
  • lower memory usage
  • faster data transfer in some GPU/ML scenarios

Why it matters:
Graphics, WebGPU, machine learning, and performance-oriented workloads benefit from more compact data.


🧭 The Bigger Picture

If you zoom out, you’ll notice a pattern:

  • less mutation
  • clearer intent
  • safer async handling
  • more functional data processing

JavaScript isn’t changing through flashy revolutions anymore.
It’s evolving through small, practical upgrades that quietly make everyday code cleaner and easier to reason about.

And honestly — that’s the kind of evolution I like most 🙂

Top comments (90)

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

Nice little syntactical sugar features added to JavaScript every year. Only the most important and most requested missing feature, strict type safety, is still missing.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Yeah… unfortunately TC39 has been pretty clear about this. JavaScript engines won’t be doing runtime type checking.
The direction seems to be keeping JS flexible and leaving strict type safety to tooling (like TypeScript). 🙂

Collapse
 
gesslar profile image
gesslar

This is why I have runtime type checking in my personal toolkit. Because design-type type checking is a fallacy.

I liked your article btw and found a couple of new things!

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Thanks a lot, really glad you found something new in it! 🙂
Out of curiosity, how do you handle runtime type checking? Are you using some specific tool or more of a custom solution?

Thread Thread
 
gesslar profile image
gesslar

It's a personal package called toolkit. Is it amazing? Maybe not. But it works, and I like it. :)

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Ah, I'll definitely take a look!

Collapse
 
emirjensen profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
emirjensen profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
emirjensen profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
harsh2644 profile image
Harsh

This is such a relatable and refreshingly honest take, Sylvia! 👏

First off, massive respect for maintaining the consistency of a weekly post even when life feels like juggling ten parallel storylines — that kind of discipline is what separates passionate creators from the rest. And you're absolutely right: sometimes the 'lighter' posts turn out to be the most impactful because they remove the friction of discovery.

Your point about curated lists hits home. You mentioned it perfectly — 'before you can search for something, you don't know it exists.' That’s the hidden curriculum of software development. We have all the documentation in the world, but discoverability is still the biggest bottleneck. Posts like your previous one on 'Stop Installing Libraries: 10 Browser APIs That Already Solve Your Problems' act as bridges between 'what we know' and 'what we could be using.' They save developers hours of reinventing the wheel.

I'm genuinely excited for this roundup of 16 modern JavaScript features. With the ecosystem evolving as fast as it does, it's easy to miss elegant solutions hiding in plain sight — optional chaining, nullish coalescing, logical assignment operators, weakRefs, or even the newer array methods. A well-structured, opinionated list from an experienced developer is worth more than a thousand scattered docs.

Also, kudos for choosing to write this yourself instead of outsourcing it to AI. That human touch — the context, the struggle, the curiosity — is exactly what makes developer content valuable and trustworthy.

Looking forward to the post. And seriously, take a breather once this is out — you've earned it! ☕😊

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much! 🙂
And yes — exactly that. The ecosystem evolves so fast that not everyone has the time (or energy 😄) to keep tracking what TC39 is deciding at any given moment.
That’s why I like doing these kinds of summaries — a chance to slow things down a bit, connect the dots, and make discovery easier for everyone. Really appreciate your kind words!

Collapse
 
xwero profile image
david duymelinck

The one thing on the list that shocked me is that intersection, union and difference are so new(ish). Set has been added a while before those methods.

There are a few things that rung my WTF bell.

For the at method, a less hacky way is arr.reverse()[0]. You showed the important part in the findLast method old way example.

For the iterator helpers I think there is a key piece missing. Instead of iterator you could have written arr.values(). Array also uses the Iterator object, but the Array.prototype.map method does not. That is what makes the Iterator implementation confusing.
I have gone back to a loop if there are only a few actions needed, like in the example, because it creates more consistent and explicit code.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thanks for the thoughtful comment! 🙂

You’re absolutely right about the iterator helpers, thanks for pointing that out. The distinction between Array.prototype.map() and the new Iterator.prototype.map() can definitely be confusing, and mentioning arr.values() would have made that clearer. I appreciate the clarification!

As for reverse(), that’s exactly why I tend to avoid it in examples. It mutates the array, which isn’t always what we want (especially in a post that praises immutability 😄). But yes, historically there were multiple ways people approached it.

And I fully get your point about loops. 🙂

Thanks again for the great input!

Collapse
 
kamil7x profile image
Kamil Trusiak

Great post, as always! :)

Promise.withResolvers is such a good thing.

I had a task, where it could really help. Unfortunately had to use fallback, because of target version :/

And I'm glad toSorted and friends exist now. Immutability helps prevent so many issues. Combine this with pure functions and you get very nice and predictable code.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thanks a lot! 🙂
And yes, I totally agree - immutability combined with pure functions makes life so much easier. You stop constantly wondering whether you’ve just broken half of the app somewhere else 😄
Also, I personally really like the new Set methods - they remove so much annoying boilerplate and finally make set operations feel natural in JS.

Collapse
 
emirjensen profile image
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
pascal_cescato_692b7a8a20 profile image
Pascal CESCATO

You’re absolutely right, Sylwia — a carefully curated list is always welcome… and that’s exactly why it’s always such a pleasure to read your work. Your article on browser APIs was so well received for a reason, and this one follows the same path: it’s not another generic “10 must-know features” list with no depth, but your list — shaped by real research, thoughtful selection, and that unmistakable writing style.

And of course, the substance is there. I fully agree with your point: these are small improvements, but the kind that make code more readable and more robust. I’d add one more thing — they do all that without breaking what already works, which might be their greatest strength.

Looking forward to the next one already.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Huge thanks, Pascal! 🙂
That’s exactly the idea — for someone to learn something new, discover a few useful things… and hopefully have a bit of fun and a smile along the way too.
Really happy you enjoyed it!

Collapse
 
emirjensen profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
adamthedeveloper profile image
Adam - The Developer

awesome content as always. I am embarrassed to say I had just discovered Object.groupBy() through this article.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

No need to be embarrassed at all 😄
JavaScript moves so fast these days that it’s really hard to keep up with everything.

Collapse
 
emirjensen profile image
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
alptekin profile image
alptekin I. • Edited

Hi Sylwia,
huge thanks. again lots to learn.
May i just ask where you follow these new features? mdn?
br
alptekin

ps. writing and publishing each week is really.. something.. great!... I could not even start my blogs yet, can not spare quality time on this. But i hope to start in March, hopefully.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much! 🙂
Honestly, posting once a week isn’t the hard part for me — the real challenge is finding time for the more ambitious deep-dive articles 😄

And that’s a great question about where to follow new features. I’d definitely recommend subscribing to newsletters like JavaScript Weekly (and similar ones). They’re great for staying up to date with what’s happening in the ecosystem.
I don’t read everything from top to bottom either — but it helps me see the direction things are going, and at least the names and ideas don’t feel completely new later.

Collapse
 
luftietheanonymous profile image
Luftie The Anonymous

Wow, cheers Sylwia for this article and the features of JS/TS presented here. It's really tough to keep upto date with everything. Will definitely try out one of the features at least.

Anyways, Idk if you use AI for your articles or not but the skills of writing are massive, congrats keep up !

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much, really appreciate it! 🙂
And honestly, I’ll be transparent about it: as a non-native speaker I do use AI sometimes to help me catch language mistakes or smooth out phrasing, but I watch it very carefully to make sure it doesn’t change the actual content or my voice 😄
Glad you enjoyed the article!

Collapse
 
luftietheanonymous profile image
Luftie The Anonymous • Edited

No worries at all, it's ok, Sylwia. I'm your country-man actually :D

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Hahaha, Polish power then! 😄

Collapse
 
emirjensen profile image
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
trinhcuong-ast profile image
Kai Alder

Object.groupBy() is the one I've been waiting for the longest. I had a custom groupBy utility function that I literally copy-pasted between projects for years. Finally don't need it anymore.

The iterator helpers are interesting but I'm curious how adoption will go. The lazy evaluation is great in theory, but in practice most of my arrays are small enough that the intermediate allocations don't matter. Where I could see it making a real difference is server-side — like processing large CSV imports or log files where you're chaining map/filter on thousands of rows.

One thing I'd love to see added to a future post: using declarations (explicit resource management). It's like Python's with statement or C#'s using — automatic cleanup for file handles, DB connections, etc. Still Stage 3 I think but it's going to change how we write cleanup code.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Yeah, I’m really looking forward to using declarations as well — that proposal is super interesting.
The idea of automatic cleanup built into the language (without wrapping everything in try/finally) feels like a very natural evolution for JavaScript, especially for server-side code and resource-heavy workflows.
And yes, last time I checked it’s still Stage 3, so hopefully we’ll see it land not too far in the future. It definitely deserves its own section in a future post 🙂

Collapse
 
emirjensen profile image
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Collapse
 
manu_ profile image
Manu Krishnan

I didn't realize how much I needed a break from AI headlines until I found this. It’s so nice to focus on pure coding again! This was exactly the 'dopamine hit' my feed needed. Thanks for keeping it technical and positive!

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Haha, totally this! 😄
I also get a bit tired of AI headlines sometimes — at this point I’m not even sure whether I should be excited or slightly terrified anymore 😄
Glad this post felt like a nice technical break!

Collapse
 
emirjensen profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Emir John

Hello, nice to meet you.
I’m a software developer, lead a small team and looking to expand my business. For this, I’m seeking local business partners who can support operations in their region.
No special technical skills are required. This is a paid monthly role, and we highly value passion, honesty, and responsibility.
All positions are fully remote, part-time (1–2 hours per day), and percentage-based, offering flexibility to work from anywhere and at any time. There are also strong opportunities for long-term growth and ongoing collaboration.
If you’re interested, I’d be happy to discuss the details further.

Telegram: @miracle0416
Discord: @gouka12
Thank you.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.