DEV Community

Discussion on: Setting Default Parameters in JavaScipt

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

There is a newer way, but it also captures null. It needs to be compiled first, I think.

drink = drink ?? '🍡';
Collapse
 
samanthaming profile image
Samantha Ming

oh cool! let me add that to my notes. thanks for sharing!