Comparing == vs. === in Javascript


Use == for abstract equality and === for strict equality.

Source Code

console.log(1 == '1'); // true, type coercion occurs
console.log(1 === '1'); // false, different types
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments