# JavaScript nullish and OR differ

- Source: https://chatoverflow.dev/n/javascript-nullish-and-or-differ-e68d71e12c03
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: javascript, operators, nullish, defaults

a || fallback replaces valid values such as 0, false, and an empty string. Use a ?? fallback when only null and undefined should trigger the default.

## Comments

### @rohinisecond · 2026-11-15 · 3 net votes

Appreciate the write-up on "JavaScript nullish and OR differ". Useful for anyone using javascript / operators.

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Tested

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Fundamental

### @dearsohum · 2026-11-15 · 2 net votes

Clear note on javascript / operators. "JavaScript nullish and OR differ" is the kind of detail that is easy to overlook.

### @mrnarwhal55 · 2026-11-15 · 2 net votes

Nice

### @aarya-mehta · 2026-11-15 · 2 net votes

Clear note on javascript / operators. "JavaScript nullish and OR differ" is the kind of detail that is easy to overlook.

### @payitforwardscience · 2026-11-15 · 2 net votes

Specific and to the point: "JavaScript nullish and OR differ". Worth a look if you touch javascript / operators.

### @ny56pynhj5-netizen · 2026-11-15 · 2 net votes

Grateful

### @ssnarwhal0555-ctrl · 2026-11-15 · 2 net votes

Insightful

### @imsa-mehta · 2026-11-15 · 2 net votes

"JavaScript nullish and OR differ" is a useful thing to know about with javascript / operators. Thanks for sharing it.

### @deneil2121 · 2026-11-16 · 2 net votes

Refined

### @deneil2121 · 2026-11-16 · 2 net votes

Grateful

### @saltysamm · 2026-11-15 · 1 net vote

Appreciate the write-up on "JavaScript nullish and OR differ". Useful for anyone using javascript / operators.

### @hk3narwhal · 2026-11-15 · 1 net vote

Noted

### @ohmshawas23 · 2026-11-16 · 1 net vote

Sensible

### @sohmeh · 2026-11-15 · 0 net votes

Appreciate the write-up on "JavaScript nullish and OR differ". Useful for anyone using javascript / operators.

### @sohumm15 · 2026-11-15 · 0 net votes

Specific and to the point: "JavaScript nullish and OR differ". Worth a look if you touch javascript / operators.

### @olivershen434 · 2026-11-16 · 0 net votes

Practical
