X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Boolean.js diff --git a/docs/output/Boolean.js b/docs/output/Boolean.js new file mode 100644 index 00000000..9feefe7b --- /dev/null +++ b/docs/output/Boolean.js @@ -0,0 +1 @@ +Ext.data.JsonP.Boolean({"tagname":"class","html":"
Files
The Boolean
object is an object wrapper for a boolean value.
The value passed as the first parameter is converted to a boolean value, if necessary. If value is\nomitted or is 0, -0, null, false, NaN
, undefined, or the empty string (\"\"), the object has an\ninitial value of false. All other values, including any object or the string \"false\"
, create an\nobject with an initial value of true.
Do not confuse the primitive Boolean values true and false with the true and false values of the\nBoolean object.
\n\nAny object whose value is not undefined
or null
, including a Boolean object whose value is false,\nevaluates to true when passed to a conditional statement. For example, the condition in the following\nif statement evaluates to true:
x = new Boolean(false);\nif (x) {\n // . . . this code is executed\n}\n
\n\nThis behavior does not apply to Boolean primitives. For example, the condition in the following if\nstatement evaluates to false
:
x = false;\nif (x) {\n // . . . this code is not executed\n}\n
\n\nDo not use a Boolean
object to convert a non-boolean value to a boolean value. Instead, use Boolean\nas a function to perform this task:
x = Boolean(expression); // preferred\nx = new Boolean(expression); // don't use\n
\n\nIf you specify any object, including a Boolean object whose value is false, as the initial value of a\nBoolean object, the new Boolean object has a value of true.
\n\nmyFalse = new Boolean(false); // initial value of false\ng = new Boolean(myFalse); // initial value of true\nmyString = new String(\"Hello\"); // string object\ns = new Boolean(myString); // initial value of true\n
\n\nDo not use a Boolean object in place of a Boolean primitive.
\n\nbNoParam = new Boolean();\nbZero = new Boolean(0);\nbNull = new Boolean(null);\nbEmptyString = new Boolean(\"\");\nbfalse = new Boolean(false);\n
\n\nbtrue = new Boolean(true);\nbtrueString = new Boolean(\"true\");\nbfalseString = new Boolean(\"false\");\nbSuLin = new Boolean(\"Su Lin\");\n
\n\nReturns a string of either \"true\" or \"false\" depending upon the value of the object.\nOverrides the Object.prototype.toString
method.
The Boolean object overrides the toString
method of the Object
object; it does not inherit\nObject.toString
. For Boolean objects, the toString
method returns a string representation of\nthe object.
JavaScript calls the toString
method automatically when a Boolean is to be represented as a text\nvalue or when a Boolean is referred to in a string concatenation.
For Boolean objects and values, the built-in toString
method returns the string \"true\"
or\n\"false\"
depending on the value of the boolean object. In the following code, flag.toString
\nreturns \"true\"
.
var flag = new Boolean(true)\nvar myVar = flag.toString()\n
\nThe boolean value represented as a string.
\nReturns the primitive value of the Boolean
object. Overrides the Object.prototype.valueOf
method.
The valueOf
method of Boolean returns the primitive value of a Boolean object or literal Boolean\nas a Boolean data type.
This method is usually called internally by JavaScript and not explicitly in code.
\n\nx = new Boolean();\nmyVar = x.valueOf() //assigns false to myVar\n
\nThe primitive value.
\n