UNPKG
@prelude/cmp
Version:
latest (4.2.0)
4.2.0
4.1.0
4.0.0
3.0.0
2.0.0
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.2
Cmp module.
@prelude/cmp
/
mjs
/
max.js
5 lines
•
246 B
JavaScript
View Raw
1
2
3
4
5
import
{ asc }
from
'./prelude.js'
;
/**
@returns
maximum element from provided list of arguments. */
const
max
= (
cmp, first, ...rest
) => rest.
reduce
(
(
r, _
) =>
cmp
(r, _) === asc ? _ : r, first);
export
default
max;
//# sourceMappingURL=max.js.map