DEV Community

Cover image for The Coolest JavaScript Features from the Last 5 Years

The Coolest JavaScript Features from the Last 5 Years

Pippa Thompson on February 27, 2023

According to Erik Qualman, language is always evolving. Although he was referring to natural language, the same applies to programming languages to...
Collapse
 
danielepecora profile image
Daniele Pecora

Thanks for sharing and see how JS evolves

Collapse
 
kvetoslavnovak profile image
kvetoslavnovak

Nice. And interesting choice of the books by the way :-)

Collapse
 
zyabxwcd profile image
Akash

.flat(Infinity), the numeric separator and your fist name were my favourite and key takeways from this article. Cheers!

Collapse
 
ppiippaa profile image
Pippa Thompson

.flat(Infinity) is definitely a helpful one ☺️ thanks for reading!

Collapse
 
citronbrick profile image
CitronBrick

Thorough article. Did not know about the flat method's argument earlier.
I wonder about the babel support though.

Collapse
 
ppiippaa profile image
Pippa Thompson

Thanks! Good point about babel support. Looks like some people have had an issue with .flat() using Babel and have implemented core.js polyfills to solve the problem.

Collapse
 
chasm profile image
Charles F. Munat

Nice! I forgot about the pad methods. Very useful.

Collapse
 
steffennilsen profile image
Steffen Nilsen

I use most of these all the time, but I had missed the Nullish Coalescing ?? operator. Very useful article for picking up the practical changes in JavaScript over the past few years.

Collapse
 
louiecodes profile image
L O U I S

Thanks for sharing, they're very useful. Only knew a few 😁

Collapse
 
ppiippaa profile image
Pippa Thompson

Glad you found it useful ☺️

Collapse
 
budyk profile image
Budy

Amazing post @ppiippaa 👏👏

Collapse
 
ppiippaa profile image
Pippa Thompson

Thanks so much ☺️

Collapse
 
flyingcrp profile image
flyingCrp

Thanks for sharing;
I used almost all of them, except Numeric Separator and fromEntries

Collapse
 
philsav2017 profile image
Philip

This is good, very useful Pippa

Collapse
 
efpage profile image
Eckehard • Edited

Thank you for sharing. Maybe it´s worth to note, that not all features are supported by all browsers, which might break your site, if you do not use any polyfills.

You can check browser compatibility on caniuse.com/. From my personal experience (not verified!) you are relatively save to use only features, that have been introduced 3-4 years back in time.

Collapse
 
ppiippaa profile image
Pippa Thompson

Very good point, that's definitely something to bear in mind with newer features. I'll be sure to add the caniuse link in the article, so thanks for pointing that out :)

Collapse
 
pratik_dev profile image
Pratik

nice one :)
could you please add one comma in code?
e.g. comma after 2 is missing.
from const nestedArray = [1, 2 [3, 4, [5, [6, 7]]]];
to const nestedArray = [1, 2, [3, 4, [5, [6, 7]]]];

Collapse
 
ppiippaa profile image
Pippa Thompson

Thanks for pointing that out, I'll go and edit it now :)

Collapse
 
9opsec profile image
9opsec

Very informative. Some of these are new to me.

Collapse
 
ppiippaa profile image
Pippa Thompson

Glad you found it helpful!

Collapse
 
preethi_dev profile image
Preethi⚡

I love💗 the Numeric Separator(_)

Thanks for listing the nice features and also a nice refresher.
Keep writing @ppiippaa

Collapse
 
ppiippaa profile image
Pippa Thompson

It definitely makes things easier to read 🤣Thanks for reading!

Collapse
 
muneerahmedkhan profile image
Muneer Khan

refreshed the concepts again thanks for sharing

Collapse
 
ppiippaa profile image
Pippa Thompson

Glad you found it helpful, thanks for reading ☺️

Collapse
 
avicohennehemia profile image
Avi Cohen Nehemia

Very nice list! I would add structuredClone as one of my top picks. It has solved the very old problem of copying objects in JS without risking mutations!

Collapse
 
ppiippaa profile image
Pippa Thompson

Thanks ☺️ I hadn't heard of structuredClone before so I will definitely have to look into it as that sounds very useful!