Home Reference Source Test

Function

Static Public Summary
public

difference(setB: Set): Set

Calculates the difference of two sets.

public

equals(setB: Set): boolean

Checks whether two sets are equal to each other.

public

from(arg: *): Set

Creates a Set from single values and iterables.

public

intersection(setB: Set): Set

Calculates the intersection of two sets.

public

iterator(ascending: boolean): function(): *, peek

Returns an iterator over an array in a specific direction.

public

limit(limit: number): Set

Limits the number of items in the set.

public

sampleElement(s: Set<T>): T

Returns an element of a Set.

public

union(setB: Set): Set

Calculates the union of two sets.

Static Public

public difference(setB: Set): Set source

Calculates the difference of two sets. Method of Set.

Params:

NameTypeAttributeDescription
setB Set

The second set.

Return:

Set

The difference of this set and the second set.

public equals(setB: Set): boolean source

Checks whether two sets are equal to each other. Method of Set.

Params:

NameTypeAttributeDescription
setB Set

The second set.

Return:

boolean

True if they contain the same elements, false otherwise.

public from(arg: *): Set source

Creates a Set from single values and iterables. If arg is not iterable, it creates a new Set with arg as its single member. If arg is iterable, it iterates over arg and puts all items into the Set. Static method of Set.

Params:

NameTypeAttributeDescription
arg *

The argument to create the Set from.

Return:

Set

The resulting Set.

public intersection(setB: Set): Set source

Calculates the intersection of two sets. Method of Set.

Params:

NameTypeAttributeDescription
setB Set

The second set.

Return:

Set

The intersection of this set and the second set.

public iterator(ascending: boolean): function(): *, peek source

Returns an iterator over an array in a specific direction. It does not handle or reflect changes of the array while iterating it.

Params:

NameTypeAttributeDescription
ascending boolean

Whether to traverse the array in ascending direction.

Return:

function(): *, peek

An iterator.

public limit(limit: number): Set source

Limits the number of items in the set.

Params:

NameTypeAttributeDescription
limit number
  • optional

Limits the number of results if given.

Return:

Set

public sampleElement(s: Set<T>): T source

Returns an element of a Set. Static method of Set.

Params:

NameTypeAttributeDescription
s Set<T>

The set to return an element from.

Return:

T

An element of the set.

public union(setB: Set): Set source

Calculates the union of two sets. Method of Set.

Params:

NameTypeAttributeDescription
setB Set

The second set.

Return:

Set

The union of this set and the second set.