let<R> method

R let<R>(
  1. R block(
    1. T
    )
)

Calls block with this value and returns the result.

Useful for transforming a value inline without a temporary variable.

'hello'.let((s) => s.toUpperCase()) // 'HELLO'
user.let((u) => u.name)             // user.name

Implementation

R let<R>(R Function(T) block) => block(this);