-
Notifications
You must be signed in to change notification settings - Fork 16
/
deno_sort_min_max.deno.txt
32 lines (22 loc) · 1.75 KB
/
deno_sort_min_max.deno.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
DENO_SORT_MIN_MAX
ALTERNATIVES ==> #See sort-on
VERSION ==> #Part of Deno
#Browser compatible
std/collections/sort_by.ts
sortBy(ARR,
FUNC(VAL)->NUM|BIGINT|STR|DATE
[, OPTS])->ARR #Sort using FUNC return value
OPTS.order #'asc' (def) or 'desc'
std/collections/min|max_with.ts
min|maxWith(ITERABLE,
FUNC(VAL, VAL2)->-1|0|1)->VAL #Find min|max VAL using a given comparator FUNC
std/collections/min|max_by.ts
min|maxBy(ITERABLE,
FUNC(VAL)->NUM|BIGINT|STR|DATE)
->VAL #Find min|max VAL according to FUNC return value
std/collections/min|max_of.ts
min|maxOf
(ITERABLE, FUNC(VAL)->NUM|BIGINT)
->VAL #Find min|max FUNC return value