JavaScript中Boolean对象的实例用法-创新互联
本篇内容主要讲解“JavaScript中Boolean对象的实例用法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“JavaScript中Boolean对象的实例用法”吧!
目前创新互联公司已为超过千家的企业提供了网站建设、域名、雅安服务器托管、网站改版维护、企业网站设计、西平网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。Boolean对象 {
b1 = new Boolean(true);
b2 = new Boolean(false);
b3 = new Boolean(0);
b4 = new Boolean(1);
b5 = new Boolean(null);
b6 = new Boolean(NaN);
b7 = new Boolean(undefined);
b8 = new Boolean("");
b9 = new Boolean(" ");
b10 = new Boolean("abc");
b11 = new Boolean(50.46);
document.write("b5 = new Boolean(null) =>" + b5 + "
");document.write("b6 = new Boolean(NaN)=>" + b6 + "
");document.write("b7 = new Boolean(undefined)=>" + b7 + "
");document.write("b8 = new Boolean('')=>" ,b8.valueOf(),"
");document.write("b9 = new Boolean(' ')=>" + b9 + "
");document.write("b10 = new Boolean('abc')=>" + b10 + "
");document.write("b11 = new Boolean(null)=>" + b11 + "
");}
到此,相信大家对“JavaScript中Boolean对象的实例用法”有了更深的了解,不妨来实际操作一番吧!这里是创新互联建站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
网页名称:JavaScript中Boolean对象的实例用法-创新互联
当前地址:http://hbruida.cn/article/csdjsj.html