A type of Set that has the additional guarantee that the iteration order of values will be the order in which they were added.
add
The iteration behavior of OrderedSet is the same as native ES6 Set.
Note that OrderedSet are more expensive than non-ordered Set and may consume more memory. OrderedSet#add is amortized O(log32 N), but not stable.
OrderedSet
Set
OrderedSet#add
A type of Set that has the additional guarantee that the iteration order of values will be the order in which they were
added.The iteration behavior of OrderedSet is the same as native ES6 Set.
Note that
OrderedSetare more expensive than non-orderedSetand may consume more memory.OrderedSet#addis amortized O(log32 N), but not stable.