mapToListTo<R> method

List<R> mapToListTo<R>(
  1. List<R> destination,
  2. R transform(
    1. K,
    2. V
    )
)

Applies the given transform function to each entry of the original map and appends the results to the given destination.

Implementation

List<R> mapToListTo<R>(List<R> destination, R Function(K, V) transform) {
  for (var entry in entries) {
    destination.add(transform(entry.key, entry.value));
  }
  return destination;
}