|
【目录】 【上一页】 【下一页】 【索引】
BooleanThe Boolean object is an object wrapper for a boolean value.
创建源The Boolean constructor:参数
描述Use a Boolean object when you need to convert a non-boolean value to a boolean value. You can use the Boolean object any place JavaScript expects a primitive boolean value. JavaScript returns the primitive value of the Boolean object by automatically invoking the valueOf method.属性概览
方法概览
示例The following示例 create Boolean objects with an initial value of false:
bNoParam = new Boolean()
btrue = new Boolean(true) 属性prototypeRepresents the prototype for this class. You can use the prototype to add properties or methods to all instances of a class. For information on prototypes, see Function.prototype.
方法toStringReturns a string representing the specified object.
语法toString()参数无。描述Every object has a toString method that is automatically called when it is to be represented as a text value or when an object is referred to in a string concatenation.You can use toString within your own code to convert an object into a string, and you can create your own function to be called in place of the default toString method. For Boolean objects and values, the built-in toString method returns "true" or "false" depending on the value of the boolean object. In the following code, flag.toString returns "true".
flag = new Boolean(true)
【目录】 【上一页】 【下一页】 【索引】 |