let<R> method

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

Calls the specified function f with as its argument and returns the result.

Example:

int? result = 'hello'.let((s) => s.length); // result = 5

Implementation

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