Methods
(static) max(numbersnon-null) → {number}
Returns the biggest number from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
(static) mean(numbersnon-null) → {number}
Returns the mean from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
Example
import { mean } from 'main-fns';
const numbers = [3, 1, 5];
console.log(mean(numbers)); // 4.5
(static) median(numbersnon-null) → {number}
Returns the median from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
Example
import { median } from 'main-fns';
const numbers = [3, 1, 5];
console.log(median(numbers)); // 3
(static) min(numbersnon-null) → {number}
Returns the smallest number from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
(static) mode(numbersnon-null) → {number}
Returns the mode from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
Example
import { mode } from 'main-fns';
const numbers = [3, 1, 5, 1];
console.log(mode(numbers)); // [1]
(static) multiply(numbersnon-null) → {number}
Returns the product from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source:
Example
import { multiply } from 'main-fns';
const numbers = [3, 1, 5];
console.log(multiply(numbers)); // 15
(static) sum(numbersnon-null) → {number}
Returns the sum from numbers
Parameters:
Name | Type | Description |
---|---|---|
numbers |
Array.<number> | The numbers |
- Source: