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


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


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


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