Chromium Code Reviews| Index: sdk/lib/core/iterable.dart |
| diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart |
| index 3e7c1cbd97a3327e64d05cff823dcfb37358c120..52476bafc0ca9244084e31fb7ef879137da48cad 100644 |
| --- a/sdk/lib/core/iterable.dart |
| +++ b/sdk/lib/core/iterable.dart |
| @@ -181,6 +181,15 @@ abstract class Iterable<E> { |
| * |
| * The returned [Iterable] is lazy, and calls [f] for each element |
| * of this every time it's iterated. |
| + * |
| + * Example: |
| + * |
| + * var lists = [<int>[1, 2, 3], <int>[3, 4, 5]]; |
| + * Set<int> ints = lists.expand((list) => list).toSet(); |
| + * print(ints); |
|
floitsch
2016/08/05 09:38:40
I prefer not to write the type arguments and sets:
stanm
2016/08/05 16:48:31
Done.
|
| + * |
| + * > {1, 2, 3, 4, 5} |
| + * |
| */ |
| Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(E element)) => |
| new ExpandIterable<E, dynamic/*=T*/>(this, f); |