cmp

fun cmp(first: Any?, second: Any?): Short(source)

Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.

Throws a "DataError" DOMException if either input is not a valid key.

MDN Reference