Dart API Referencedart:coreimplListFactory<E>

ListFactory<E> Class

Constructors

Code factory List([int length]) #

factory List([int length]) => Primitives.newList(length);

Code factory List.from(Iterable<E> other) #

factory List.from(Iterable<E> other) {
  List<E> result = new List<E>();
  // TODO(ahe): Use for-in when it is implemented correctly.
  Iterator<E> iterator = other.iterator();
  while (iterator.hasNext()) {
    result.add(iterator.next());
  }
  return result;
}