FeroxCloudJoin free
3

What's the difference between `==` and `===` in JavaScript?

TSAsked by Tomás Silva · 16d

I keep seeing both. When should I use which?

1 answer

3

Accepted answer

=== compares without type coercion. Prefer it always.

javascript
console.log(0 == '0');   // true
console.log(0 === '0');  // false
FZAnswered by Fatima Zahra · 15d

Sign in to answer.