📌  相关文章
📜  javaScipt 的区别 != 和 !== - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:05.759000             🧑  作者: Mango

代码示例1
/*
   != 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