Compartilhar via


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);

Member Extensions

Name

Description

Boolean.parse Function

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

Remarks

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.

Example

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");
}

See Also

Reference

Boolean Object

boolean Data Type (Visual Studio - JScript)

new Operator

Boolean Type Functions

Other Resources

Language Reference