使用new操作符和Boolean(value)构造函数时,得到的并不是原始的true或false,而是一个对象,JS将对象视为真(true) var oBooleanTrue = new Boolean(true); var oBooleanFalse = new Boolean(false); console.log(oBooleanTrue); console.log(typeof oBooleanTrue); if(oBooleanFalse){ console.log("I an ser
JavaScript -- 知识点回顾篇(五):js中的 Date 对象的方法 Date 对象: 用于处理日期和时间. 1. Date对象的方法 <script type="text/javascript"> document.write('Date()方法:<br/>'); document.write(Date()); // 返回当日的日期和时间. document.write('<br/><br/>'); var d1=new Da