W3cubDocs

/Dart 2

HashSet<E>.of constructor

HashSet<E>.of(Iterable<E> elements)

Create a hash set containing all elements.

Creates a hash set as by new HashSet<E>() and adds all given elements to the set. The elements are added in order. If elements contains two entries that are equal, but not identical, then the first one is the one in the resulting set.

Implementation

factory HashSet.of(Iterable<E> elements) =>
    new HashSet<E>()..addAll(elements);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-collection/HashSet/HashSet.of.html