nullish
x ?? y
nullish(x, y)
Try it yourself:
| $1 |
null ?? 42
|
|
| $2 |
undefined ?? 42
|
|
| $3 |
0 ?? 42
|
|
| $4 |
false ?? 42
|
|
| $5 |
null ?? undefined ?? 42
|