IK
Interview Knowledge Book
Topics
Practice
Examples
Playground
RU
browser
Coercion and equality table
Compare ==, ===, Object.is, and truthiness for values that often appear in interviews.
index.js
const checks = [ ['0 == false', 0 == false], ['0 === false', 0 === false], ['Object.is(NaN, NaN)', Object.is(NaN, NaN)], ['[] == false', [] == false], ['Boolean([])', Boolean([])], ]; for (const [label, value] of checks) { console.log(`${label} -> ${value}`); }
Run
Stop
Reset