标签:
==判断值是否相等
===判断值以及类型是否相等
console.log(11 == "11"); //输出:true 字符串在与数字做比较或者运算时会先转换成number类型再运算 console.log(11 === "11"); //输出:false
所以判断类型的时候不仅可以用typeof()、$.type()还可以用===
注意:null、undefine判断类型要用:typeof null 、typeof undefine
null == undefine //true
null === undefine //false
标签:
原文地址:http://www.cnblogs.com/wenxiangxu/p/5667627.html