Answers for "javaScipt diference != and !=="

0

javaScipt diference != and !==

/*
   != accept 1 as equals of true, 0 as equals of false and some others
   (because the values are automatically casted when being compared).
   !== accept only "real" equalities (i.e. compares both the value and the type)
*/
alert(1 != true); //this is false
alert(1 !== true); //this is true
Posted by: Guest on May-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language