DEV Community


Discussion on: 3 Ways to Set Default Value in JavaScript

samanthaming profile image
Samantha Ming Author

Yes! “||” will capture ALL falsy values listed in the article. Definitely something to be really mindful of. Thanks for sharing your example and emphasizing that point! Very important and a very common gotcha that can cause extreme headaches 😵