DEV Community

40 JavaScript Shortcuts Every Developer Should Know in 2025

CodeWithDhanian on April 22, 2025

Created by Dhanian (@e_opore on X) JavaScript is evolving rapidly, and mastering the right shortcuts can make you a faster, smarter, and more effi...
Collapse
 
yaireo profile image
Yair Even Or
  1. missing output result for the examples
  2. missing any sort of explanation for some things which aren't self-explained
  3. number 39 "Object Clone" should mention this is a shallow cloning only
Collapse
 
hamza7681 profile image
Hamza Siddique

function greet(name = "Guest") {
return
Hello, ${name};
}

It is good practice to pass parameters in object rather than this old way, this will save the sequence issue and undefined issue

function greet({name = "Guest"}) {
return
Hello, ${name};
}

Collapse
 
nibelune profile image
Benoît Schiex

No...It's not always a good practice. And here, it's a bad one.

It's usefull when you have a function with 3+ parameters, cause it improve usability/readability
it's a bad practice on simple functions especially when you use Javascript :

  • poor autocompletion
  • poor readability
  • risk of silent undefined issues (when JS evaluate an objet property that doesn't exist, it won't throw an error but just returns undefined)
Collapse
 
code_2 profile image
CodeWithDhanian

Thanks for checking out

Collapse
 
biru_basfore profile image
Biru Basfore

Thanks for sharing this valuable information 🥰

Collapse
 
code_2 profile image
CodeWithDhanian

Thanks for checking out

Collapse
 
biru_basfore profile image
Biru Basfore

You're welcome.

Collapse
 
eudeferraz profile image
eudeferraz

Learned new things from your post, thank you for sharing with us!!

Collapse
 
minionarmytothemoon profile image
Minion Army

How are people still putting these moronic articles out for things that have been here for almost a decade now.

Collapse
 
code_2 profile image
CodeWithDhanian

To make JavaScript easier

Collapse
 
palsang_ghising_15dbe1d8e profile image
Palsang Ghising

As a beginner so much useful information, just in one page. Thanks bro.

Collapse
 
code_2 profile image
CodeWithDhanian

Thanks for checking out

Collapse
 
clint_hiles_2ca3cc9412167 profile image
Clint Hiles

StucturedClone is good to

Collapse
 
collinzo2022 profile image
Efuetanu Collins

Nice one, l had to go through to check if l was a really js developer😁

Collapse
 
theme_selection profile image
ThemeSelection

Great collection..!!
Thanks for sharing.

Collapse
 
raldjie profile image
Jeirald Lepaopao

Thank you for sharing