# Set

A set of unique generic values.

The Set API is very similar to JavaScript's (MDN (opens new window)), but iterators are not implemented yet.

# Constructor

  • new Set<T>()
    Constructs a new set of unique value of type T.

# Instance members

# Fields

  • readonly size: i32
    The current number of unique values in the set.

# Methods

  • function add(value: T): void

    Adds the specified value to the set. Does nothing if the value already exists.

  • function delete(value: T): bool

    Deletes the specified value. Returns true if the value was found, otherwise false.

  • function clear(): void

    Clears the set, deleting all values.

  • function has(value: T): bool

    Tests if the specified value exists in the set.

  • function values(): Array<T>

    Gets the values contained in this set as an array, in insertion order. This is preliminary while iterators are not supported.

  • function toString(): string

    Returns a string representation of this set.