== versus ===
== converts types before comparing and gives surprises. === compares value and type. Prefer === and !==. Object.is handles NaN and -0.
Example
console.log(1 == "1", 1 === "1");
console.log(0 == false, 0 === false);
console.log(NaN === NaN, Object.is(NaN, NaN));Exercise
Strict equality.
1 "1"
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.