letOr<R> method

R letOr<R>(
  1. R block(
    1. T it
    ), {
  2. required R defaultValue,
})

Executes block when non-null, returning defaultValue if the receiver is null.

Unlike let, this always returns a non-null result.

Implementation

R letOr<R>(R Function(T it) block, {required R defaultValue}) =>
    this == null ? defaultValue : block(this as T);