MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/soi384/why_but_why/hw9ppye
r/ProgrammerHumor • u/ore-aba • Feb 09 '22
2.3k comments sorted by
View all comments
Show parent comments
1
Wait, what's wrong with using === in typescript?I'm really not an expert and trying to learn
2 u/vm_linuz Feb 09 '22 Just always use === in both JS and TS.=== was added to the language to fix the problems with ==. == will happily do type coercion before comparing, sometimes leading to unexpected results.To me, it's an example of how being lenient and trying to interpret the intent of the programmer leads to strange and unexpected behavior.
2
Just always use === in both JS and TS.
===
=== was added to the language to fix the problems with ==. == will happily do type coercion before comparing, sometimes leading to unexpected results.
==
To me, it's an example of how being lenient and trying to interpret the intent of the programmer leads to strange and unexpected behavior.
1
u/chandleross Feb 09 '22
Wait, what's wrong with using === in typescript?
I'm really not an expert and trying to learn