Javascript 学习笔记之基本运算符测试
/* -------------------------
Javascript 基本运算符测试
----------------------------*/
function writeline(message)
{
document.write(message);
document.write("<br>");
}
//instanceof
var num = new Number(11);
var str = new String("hello");
writeline(num instanceof Number); //true;
writeline(str instanceof String);
//delete
var o = new Object();
o.name = "Jack";
writeline(o.name); //jack
delete(o.name);
writeline(o.name); //undefined
//void 对所有值返回undefined
writeline(void(new Object())); //undefined
writeline(void(1)); //undefined
writeline(void("st5r")); //undefined
<待续>
Javascript 基本运算符测试
----------------------------*/
function writeline(message)
{
document.write(message);
document.write("<br>");
}
//instanceof
var num = new Number(11);
var str = new String("hello");
writeline(num instanceof Number); //true;
writeline(str instanceof String);
//delete
var o = new Object();
o.name = "Jack";
writeline(o.name); //jack
delete(o.name);
writeline(o.name); //undefined
//void 对所有值返回undefined
writeline(void(new Object())); //undefined
writeline(void(1)); //undefined
writeline(void("st5r")); //undefined
<待续>