DEV Community

Discussion on: Breaking Down ES6: Default Parameters

Collapse
 
codingsam profile image
Coding Sam • Edited

It really is a great feature.
But be carefull because, the default values only work for undefined. If those functions receive null as values for some arguments with default values, they will be kept as null.
I got caught by this so many times :)

Collapse
 
torianne02 profile image
Tori Crawford

Thank you so much for adding this little tidbit! I didn't think to make note of it. :)

Collapse
 
codingsam profile image
Coding Sam

A lot of developers, specially beginners can get tricked by this small detail. :)