Jump to navigation

Namespace: setmath

Numbas.setmath

Set operations.

Source:

Methods

(static) contains(set, element) → {Boolean}

Does the set contain the given element?

Parameters:
Name Type Description
set set
element *
Returns:
Type Description
Boolean
Source:

(static) eq(a, b) → {Boolean}

Are two sets equal? Yes if a,b and (a intersect b) all have the same length

Parameters:
Name Type Description
a set
b set
Returns:
Type Description
Boolean
Source:

(static) intersection(a, b) → {set}

Intersection of two sets

Parameters:
Name Type Description
a set
b set
Returns:
Type Description
set
Source:

(static) minus(a, b) → {set}

Set minus - remove b's elements from a

Parameters:
Name Type Description
a set
b set
Returns:
Type Description
set
Source:

(static) size(set) → {Number}

Size of a set

Parameters:
Name Type Description
set set
Returns:
Type Description
Number
Source:

(static) union(a, b) → {set}

Union of two sets

Parameters:
Name Type Description
a set
b set
Returns:
Type Description
set
Source: