您的位置:首页 > 其它

比较运算

2015-07-31 16:46 435 查看
1

undefined>-1

一个是数值

先转化另一个为数,后台调用Number()方法

Number(undefined);//NaN


2

任何数值和NaN比较,false

null,undefined

null==undefined; //true
null!=undefined; //false
null==0; //false
undefined==0;//false


3

typeof返回"字符串"!!

4

蛋疼的IE

function f(a,b){var i=a;};
console.log(typeof f);//function

console.log(typeof ActiveXObject);//undefined
var xmldom=new ActiveXObject('MSXML2.DOMDocument.6.0');
console.log(typeof xmldom);//object
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: