- <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_学习_7:Boolean对象
最新推荐文章于 2024-08-29 21:42:20 发布