JavaScript中Boolean对象的实例用法
本文主要介绍"JavaScript中Boolean对象的实例用法",希望能够解决您遇到有关问题,下面我们一起来看这篇 "JavaScript中Boolean对象的实例用法" 文章。
- <html>
- <head>
- <TITLE>Boolean对象</TITLE>
- <SCRIPT Language = "JavaScript">
- {
- 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 + "<br>");
- document.write("b6 = new Boolean(NaN)=>" + b6 + "<br>");
- document.write("b7 = new Boolean(undefined)=>" + b7 + "<br>");
- document.write("b8 = new Boolean('')=>" ,b8.valueOf(),"<br>");
- document.write("b9 = new Boolean(' ')=>" + b9 + "<br>");
- document.write("b10 = new Boolean('abc')=>" + b10 + "<br>");
- document.write("b11 = new Boolean(null)=>" + b11 + "<br>");
- }
- </SCRIPT>
- </head>
- </html>
关于 "JavaScript中Boolean对象的实例用法" 就介绍到这。希望大家多多支持编程宝库。
本文主要介绍"JavaScript中String对象的字符串格式化方法",希望能够解决您遇到有关问题,下面我们一起来看这篇 "JavaScript中String对象的字符串格式化方法 ...