mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
721 B
721 B
Function setDistinct
Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.
Syntax
math.setDistinct(set)
Parameters
| Parameter | Type | Description |
|---|---|---|
a |
Array | Matrix | A multiset |
Returns
| Type | Description |
|---|---|
| Array | Matrix | A set containing the distinc elements of the multiset |
Examples
math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]