i mean, just its name is cool enough, “Nullish Coalescing”

javascript’s ?? is cool

comments (single view)

Here’s an example:

> 1 ?? 0
1
> undefined ?? 0
0
> bork ?? 0 // bork is not defined
0

wait, the last one isn’t correct, I think I’ve confused it with an object :P

View all comments