Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • difference(other: Set<any>): Set<any>
  • Return the difference of two sets.

    Parameters

    • other: Set<any>

      Some other set to compare against

    Returns Set<any>

    The difference defined as objects in this which are not present in other

  • symmetricDifference(other: Set<any>): Set<any>
  • Return the symmetric difference of two sets.

    Parameters

    • other: Set<any>

      Another set.

    Returns Set<any>

    The set of elements that exist in this or other, but not both.

  • equals(other: Set<any>): boolean
  • Test whether this set is equal to some other set. Sets are equal if they share the same members, independent of order

    Parameters

    • other: Set<any>

      Some other set to compare against

    Returns boolean

    Are the sets equal?

  • first(): any
  • Return the first value from the set.

    Returns any

    The first element in the set, or undefined

  • intersection(other: Set<any>): Set<any>
  • Return the intersection of two sets.

    Parameters

    • other: Set<any>

      Some other set to compare against

    Returns Set<any>

    The intersection of both sets

  • intersects(other: Set<any>): boolean
  • Test whether this set has an intersection with another set.

    Parameters

    • other: Set<any>

      Another set to compare against

    Returns boolean

    Do the sets intersect?

  • union(other: Set<any>): Set<any>
  • Return the union of two sets.

    Parameters

    • other: Set<any>

      The other set.

    Returns Set<any>

  • isSubset(other: Set<any>): boolean
  • Test whether this set is a subset of some other set. A set is a subset if all its members are also present in the other set.

    Parameters

    • other: Set<any>

      Some other set that may be a subset of this one

    Returns boolean

    Is the other set a subset of this one?

  • toObject(): any[]
  • Convert a set to a JSON object by mapping its contents to an array

    Returns any[]

    The set elements as an array.

  • every(test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)): boolean
  • Test whether every element in this Set satisfies a certain test criterion.

    see

    Array#every

    Parameters

    • test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)

      The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.

        • (arg0: any, arg1: number, arg2: Set<any>): boolean
        • Parameters

          • arg0: any
          • arg1: number
          • arg2: Set<any>

          Returns boolean

    Returns boolean

    Does every element in the set satisfy the test criterion?

  • filter(test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)): Set<any>
  • Filter this set to create a subset of elements which satisfy a certain test criterion.

    see

    Array#filter

    Parameters

    • test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)

      The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being filtered.

        • (arg0: any, arg1: number, arg2: Set<any>): boolean
        • Parameters

          • arg0: any
          • arg1: number
          • arg2: Set<any>

          Returns boolean

    Returns Set<any>

    A new Set containing only elements which satisfy the test criterion.

  • find(test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)): any
  • Find the first element in this set which satisfies a certain test criterion.

    see

    Array#find

    Parameters

    • test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)

      The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being searched.

        • (arg0: any, arg1: number, arg2: Set<any>): boolean
        • Parameters

          • arg0: any
          • arg1: number
          • arg2: Set<any>

          Returns boolean

    Returns any

    The first element in the set which satisfies the test criterion, or undefined.

  • map(transform: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)): Set<any>
  • Create a new Set where every element is modified by a provided transformation function.

    see

    Array#map

    Parameters

    • transform: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)

      The transformation function to apply.Positional arguments are the value, the index of iteration, and the set being transformed.

        • (arg0: any, arg1: number, arg2: Set<any>): boolean
        • Parameters

          • arg0: any
          • arg1: number
          • arg2: Set<any>

          Returns boolean

    Returns Set<any>

    A new Set of equal size containing transformed elements.

  • reduce(reducer: ((arg0: any, arg1: any, arg2: number, arg3: Set<any>) => any), accumulator: any): any
  • Create a new Set with elements that are filtered and transformed by a provided reducer function.

    see

    Array#reduce

    Parameters

    • reducer: ((arg0: any, arg1: any, arg2: number, arg3: Set<any>) => any)

      A reducer function applied to each value. Positional arguments are the accumulator, the value, the index of iteration, and the set being reduced.

        • (arg0: any, arg1: any, arg2: number, arg3: Set<any>): any
        • Parameters

          • arg0: any
          • arg1: any
          • arg2: number
          • arg3: Set<any>

          Returns any

    • accumulator: any

      The initial value of the returned accumulator.

    Returns any

    The final value of the accumulator.

  • some(test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)): boolean
  • Test whether any element in this Set satisfies a certain test criterion.

    see

    Array#some

    Parameters

    • test: ((arg0: any, arg1: number, arg2: Set<any>) => boolean)

      The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.

        • (arg0: any, arg1: number, arg2: Set<any>): boolean
        • Parameters

          • arg0: any
          • arg1: number
          • arg2: Set<any>

          Returns boolean

    Returns boolean

    Does any element in the set satisfy the test criterion?