Reputation: 35223
Why is
console.log('' == false); //true
but
console.log('' === false); //false
Based on this the last row should return true, right?
Upvotes: 1
Views: 55
Reputation: 6020
No, when you use ===
in javascript you're also comparing type, see this article which explains in more detail.
Upvotes: 2
Reputation: 974
Because ===
checks for types and the string is a string and false is a boolean.
Upvotes: 7