JavaScript API Reference/Common Functions

valueExists(value)

Check whether specified value is defined, and is not null. Returns true if the value exists, false if it does not.

Parameters:

  • value (any JS variable): value to check.


Example:

Execute code block only if the function parameter is defined.

function saveReservation(notificationEnabled) {
if (valueExists(notificationEnabled)) {
// send notification
}
}