Export (0) Print
Expand All

cmp method

Compares two values and indicates whether one is greater than the other.

Internet Explorer 10

 

Syntax

object.cmp(first, second, result)

Parameters

first [in]

Type: Any

second [in]

Type: Any

result [out]

Type: Number

ValueMeaning
-1

The first value is less than the second value.

0

The values are equal.

1

The first value is greater than the second value.

 

Return value

This method does not return a value.

Exceptions

This method can throw the following DOMException exceptions:

Note  As of Internet Explorer 10, the code property is deprecated in lieu of the name property, which is preferred for standards compliance and future compatibility.
Exception propertiesCondition
name: DataError

A specified value is not valid or cannot be compared.

 

Standards information

Examples

This example uses the cmp method to compare two values.


var value1 = "Alpha";
var value2 = "Beta";
var result = window.indexedDB.cmp( value1, value2 );
console.log( "Comparison results: " + result );

See also

IDBFactory
indexedDB

 

 

Show:
© 2015 Microsoft