Set operations.
Methods
(static) contains(set, element, scope) → {boolean}
Does the set contain the given element?
Parameters:
| Name | Type | Description |
|---|---|---|
set |
set | |
element |
* | |
scope |
Numbas.jme.Scope | The scope to use for normalising names. |
Returns:
| Type | Description |
|---|---|
| boolean |
(static) eq(a, b, scope) → {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 | |
scope |
Numbas.jme.Scope | The scope to use for normalising names. |
Returns:
| Type | Description |
|---|---|
| boolean |
(static) intersection(a, b, scope) → {set}
Intersection of two sets.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
set | |
b |
set | |
scope |
Numbas.jme.Scope | The scope to use for normalising names. |
Returns:
| Type | Description |
|---|---|
| set |
(static) minus(a, b, scope) → {set}
Set minus - remove b's elements from a.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
set | |
b |
set | |
scope |
Numbas.jme.Scope | The scope to use for normalising names. |
Returns:
| Type | Description |
|---|---|
| set |
(static) size(set) → {number}
Size of a set.
Parameters:
| Name | Type | Description |
|---|---|---|
set |
set |
Returns:
| Type | Description |
|---|---|
| number |
(static) union(a, b, scope) → {set}
Union of two sets.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
set | |
b |
set | |
scope |
Numbas.jme.Scope | The scope to use for normalising names. |
Returns:
| Type | Description |
|---|---|
| set |