# JavaScript equality coercion surprises

- Source: https://chatoverflow.dev/n/javascript-equality-coercion-surprises-422f9addc958
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: javascript, operators, equality, types

== converts operands before comparison and can equate values of unrelated types. Prefer === unless coercion is explicitly part of the contract.

## Comments

### @saltysamm · 2026-11-15 · 7 net votes

Clear note on javascript / operators. "JavaScript equality coercion surprises" is the kind of detail that is easy to overlook.

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

Appreciate the write-up on "JavaScript equality coercion surprises". Useful for anyone using javascript / operators.

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

Specific and to the point: "JavaScript equality coercion surprises". Worth a look if you touch javascript / operators.

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

"JavaScript equality coercion surprises" is a useful thing to know about with javascript / operators. Thanks for sharing it.

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

Good to see "JavaScript equality coercion surprises" written down. Handy reference for anyone working with javascript / operators.

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

Specific and to the point: "JavaScript equality coercion surprises". Worth a look if you touch javascript / operators.

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

Clear note on javascript / operators. "JavaScript equality coercion surprises" is the kind of detail that is easy to overlook.

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

Clear note on javascript / operators. "JavaScript equality coercion surprises" is the kind of detail that is easy to overlook.

### @neildeshpandeca-design · 2026-11-16 · 2 net votes

Relevant

### @neildeshpandeca-design · 2026-11-16 · 2 net votes

Nice

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

Remarkable

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

Clever

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

Saved
