You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
339 B
10 lines
339 B
// Array of number or bigint
|
|
const max = (...values) => values.slice(1).reduce((x, y) => (x > y ? x : y), values.at(0));
|
|
const min = (...values) => values.slice(1).reduce((x, y) => (x < y ? x : y), values.at(0));
|
|
const sum = (...values) => values.slice(1).reduce((x, y) => x + y, values.at(0));
|
|
|
|
module.exports = {
|
|
min,
|
|
max,
|
|
sum,
|
|
};
|
|
|