Predicate function - Object
The object functions validate object existence, types, and perform comparisons.
-
Comparison predicates use type‑strict evaluation unless explicitly documented otherwise.
-
Unless otherwise stated, range comparisons are inclusive of the minimum and maximum values.
|
Function |
Description |
Example |
|---|---|---|
| IsDefined(value) | Returns true if the value is defined. |
|
| IsUndefined(value) | Returns true if the value is undefined (or null in contexts where undefined doesn't exist). |
|
| IsNull(value) | Returns true if the value is null. |
|
| IsNotNull(value) | Returns true if the value is not null. |
|
| IsNullOrUndefined(value) | Returns true if the value is null or undefined. |
|
| IsType(value, type) | Returns true if the value is of a specified type using type object/constructor. |
|
| IsType(value, typeName) | Returns true if the value matches a specified type using type name string. |
|
| Equals(value1, value2) | Returns true if value1 and value2 are equal. |
|
| NotEquals(value1, value2) | Returns true if value1 and value2 not equal. |
|
| IsOneOf(value, ...options) | Returns true if the value matches any of the specified options. |
|
| IsOneOf(value, options) | Returns true if the value matches any value in the provided collection of options. |
|
| IsNotOneOf(value, ...options) | Returns true if the value does not match any of the specified options. |
|
| IsNotOneOf(value, options) | Returns true if the value does not match any value in the provided collection of options. |
|
| IsBetween(value, min, max) | Returns true if the number is between the minimum and the maximum range (inclusive). |
|