JS equality explorer

← All tools

Type two JavaScript values and see how ==, ===, and Object.is compare them — with a step-by-step breakdown of loose equality coercion.

Your inputs never leave the browser — values are parsed safely, without eval.

Classic gotchas

Value A

Value B

Results

OperatorResult
A == B
A === B
Object.is(A, B)

Truthiness

ValueTruthy?
A
B

== coercion steps

About this tool

JavaScript has two equality operators. Strict equality (===) compares type and value with no conversion. Loose equality (==) coerces types first — which leads to surprises like '' == 0 being true.

Object.is is like === except it treats NaN as equal to itself and distinguishes +0 from -0. Use the presets to walk through the comparisons that trip people up in interviews and code reviews.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →