JavaScript Boolean 对象
Boolean 对象
Boolean 对象用于转换一个不是 Boolean 类型的值转换为 Boolean 类型值 (true 或者false).
Boolean 对象属性
construtor 返回对创建此对象Boolean函数的引用
prototype 向对象添加属性和方法
Boolean 对象方法
- toString 将boolean值转换为string并返回结果
var test= new Boolean(1);
var newtest= test.toString();
document.write(newtest);
- valueOf() 返回Boolean属性的原始值
var test= new Boolean(0);
var newtest= test.valueOf();
document.write(newtest);