orDefault method

T? orDefault(
  1. T? def
)

If this is null - return def, otherwise this is called and returned value is used.

Implementation

T? orDefault(T? def) => this == null ? def : this?.call();