Export (0) Print
Expand All

Boolean Type Extensions

Provides extensions to the base ECMAScript (JavaScript) Boolean object.

Namespace: None. This type extension is global and not part of a namespace.

Inherits: None

var booleanVar = new Boolean(true);

Name

Description

Boolean.parse Function

Converts a string representation of a logical value to its Boolean object equivalent.

Boolean extensions are part of the Microsoft Ajax Library. They add functionality to the JavaScript Boolean object and provide members that are more familiar to .NET programmers.

For more information about the JavaScript object that this type extends and about its constructor, see Boolean Object in the Language Reference.

The following example shows how to create a new Boolean object and invoke the Microsoft Ajax Library parse function to create a Boolean value from a string.


var a = new Boolean(true);      
if (a == true){
    alert("a = true"); 
}else{
    alert("a = false");
}

var b = Boolean.parse("true");
if (b == true){
    alert("b = true"); 
}else{
    alert("b = false");
}


Community Additions

ADD
Show:
© 2014 Microsoft