Dart by Example: Iterables

  1. main() {
  2. // Iterable is implemented by LinkedList,List, ListQueue, Queue, Runes,
  3. // Set, and more.
  4. var set = new Set()..add('greg')..add('steve');
  5. for (var name in set) {
  6. print(name);
  7. }
  8. }
  9.  
  1. $ dart iterables.dart
  2. greg
  3. steve

by @jryanio | source | license