DEV Community

loading...

Discussion on: The new features of Javascript in 2020 (ES11)

Collapse
uzitech profile image
Tony Brix

The first example in Nullish Coalescing Operator the values should be switched around the ||s

You have 'value not falsey' || undefined which should actually be undefined || 'value not falsey', otherwise "value not falsey" will always show even for a truthy value.

('value not falsey' || true) === 'value not falsey'

Forem Open with the Forem app