bag
bag(list: List<T>) : Bag<T>
Returns a bag containing the same elements as the input list, but without any ordering guarantees.
Examples
Basic Usage
x = [3, 1, 2];
y = bag(x); // Bag containing 1, 2, 3 (order undefined)
See Also
Guides
- Collections - Comprehensive guide on Lists, Bags, and ordering