new Boolean(value)
The value to be held by the Boolean object. This argument will be converted to a Boolean value, if necessary. The values 0, null and the empty string "" are all converted to false. All other values, including the string "false", are converted to true.
The newly created Boolean object.
Return "true" or "false", depending on the Boolean value represented by the Boolean object.
Return the Boolean value represented by the Boolean object.
Boolean values are a fundamental data type in JavaScript. The Boolean object is an object wrapper around the Boolean value. This Boolean object type exists solely to provide a toString() method to convert Boolean values to strings. When the toString() method is invoked to convert a Boolean value to a string (and it is often invoked implicitly by JavaScript) JavaScript internally converts the Boolean value to a transient Boolean object, on which the method can be invoked.
You can create Boolean objects that are not transient by calling the Boolean() constructor method. One reason you might occasionally want to do so is to force a conversion of another value to a Boolean value. Having created a Boolean object, you can use it freely wherever JavaScript expects a primitive Boolean value--JavaScript will automatically invoke the valueOf() method to return the primitive value of the Boolean object.
file: /Techref/language/java/script/definitive/refp_16.htm, 5KB, , updated: 2019/10/14 15:00, local time: 2024/12/26 23:17,
18.217.26.8:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/language/java/script/definitive/refp_16.htm"> [Chapter 21] Reference: Boolean</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.