addSetItem()function

addSetItem(set: MutableSet<T>, item: T): T
ParamType
setMutableSet<T>
The mutable set to add to. required
itemT
The item to add. required
Return
T
The added item.

Add an item to a set (by reference) and return the set item.

  • Mutates set in place.

Examples

addSetItem(set, "a") // "a"