let<R> method

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

Executes block with this as the argument and returns the result.

Useful for inline transformations without intermediate variables:

final length = fetchValue().let((v) => v.toString().length);

Implementation

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