Returns its argument when the value is null. Using this method may avoid the use of an if/else block. It can be used to ensure that a method chain never returns a null value.

See also $, $val, $value.


Parameter Description
someValue The value to return when the original value is null.


// the call to any() may result is null. Thus, adding whenNull ensures that the chain never returns null.

// This complex chain, may result in null for many reasons. Again, adding the whenNull ensures the result is never null.

// Returns a text Value when null

// Returns a integer Value when null

// Applies to each value in a value sequence