Mastering default values in JavaScript with the nullish coalescing (??) operator
One piece of JavaScript syntax I’ve come to appreciate is the nullish coalescing (??) operator. It’s one of those features that’s easy to overlook until it saves you from a subtle bug. If you’re still using the logical OR (||) operator to provide default values, it’s worth knowing where the...