Error in the comparison | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Error in the comparison

The comparison might be like var1==true and var2==false using double == or ===

18th Jul 2020, 1:00 AM
Mateo Urrego
Mateo Urrego - avatar
3 Answers
+ 1
Specify your language and clarify your question. THANK YOU!
18th Jul 2020, 1:17 AM
Ćheyat - avatar
Mateo Urrego in which Lang you've make this program first clarify that
18th Jul 2020, 3:23 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar
In Javascript: For example If you have 2 == "2": Javascript will convert the string "2" to the integer 2 and then compare the two values. The result will be "True" in that case! While 2 === "2" returns "False" from the beginning. This is strict! No conversion takes place before the comparison! I hope it helps!
18th Jul 2020, 5:42 AM