Why to use "===" instead of "=="


#1

Why we have to use here "===" instead of "==" which is also correct JavaScript? Similarly "!=" is also correct instead of "!==".


#2

three equal signs also check if data type matches:

if true == "true" // true
if true === "true" // false, data type doesn't match

why its specifically used in the exercise? No idea. But its more important to understand the difference


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.