No Yes Yes No Yes No Yes No Yes No

When should you use ?? if you care about bundle size?

Using ES2020 or above?

Doing num ?? 0?

Sure, use ?? to your heart's content

Stop! Use num || 0

Doing str ?? ""?

Stop! Use str || ""

Doing bool ?? false?

Stop! Use bool || false

Doing obj ?? {}?

Stop! Use obj || {}

Proof:

// source code
num || 0
// vs
num ?? 0
// code transpiled to target < ES2020
num || 0;
// vs
num !== null && num !== void 0 ? num : 0;