📅  最后修改于: 2020-10-23 15:11:38             🧑  作者: Mango
JavaScript布尔值是一个以两种状态表示值的对象:true或false。您可以通过Boolean()构造函数创建JavaScript布尔对象,如下所示。
Boolean b=new Boolean(value);
JavaScript布尔对象的默认值为false。
Property | Description |
---|---|
constructor | returns the reference of Boolean function that created Boolean object. |
prototype | enables you to add properties and methods in Boolean prototype. |
Method | Description |
---|---|
toSource() | returns the source of Boolean object as a string. |
toString() | converts Boolean into String. |
valueOf() | converts other type into Boolean. |