Why is "5" == 5 but also "5" !== 5 ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
10th Apr 2018, 7:12 AM
Eoin O'Carroll
Eoin O'Carroll - avatar
2 Answers
+ 6
Because the second case uses strict comparison it checks types too. In the first case interpreter converts types and compares just values.
10th Apr 2018, 7:30 AM
Sergey Salnikov
Sergey Salnikov - avatar
+ 2
Thanks Sergey
10th Apr 2018, 9:10 AM
Eoin O'Carroll
Eoin O'Carroll - avatar