var line = 0;
function log(str){
line++;
document.write("<p><span style='color:blue;'>"+line+"</span>\toutput:<strong><b style='color:red;'>"
+str+"</b></strong> [Time:"+new Date()+"]</p>")
}
log("Boolean(null) = "+Boolean(null));
log("Boolean(undefined) = "+Boolean(undefined));
log("Boolean(\"\") = " + Boolean(""));
log(isFinite(3));
log(isNaN(5));
log(NaN);
log(typeof NaN);
log(typeof(Object));
log(typeof Object);
var o = new Object();
log(typeof o);
log("has property name :" + o.hasOwnProperty("name"));
log("isPrototypeOf(name) :" + Object.prototype.isPrototypeOf(Object));
//log(true++);
try{
test();
}
catch(err){
log(err);
log(err.message);
}
finally{
log("finally");
}
with(o){
log(isPrototypeOf(Object));
}
with("name"){
log(isPrototypeOf(o));
}
O=Object;
log(new O());
log(-1>>>0);//usigned int32
1 output:Boolean(null) = false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
2 output:Boolean(undefined) = false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
3 output:Boolean("") = false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
4 output:true [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
5 output:false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
6 output:NaN [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
7 output:number [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
8 output:function [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
9 output:function [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
10 output:object [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
11 output:has property name :false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
12 output:isPrototypeOf(name) :true [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
13 output:ReferenceError: test is not defined [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
14 output:test is not defined [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
15 output:finally [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
16 output:false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
17 output:false [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
18 output:[object Object] [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]
19 output:4294967295 [Time:Sun May 20 2018 23:08:35 GMT+0800 (中国标准时间)]