Skip to main content

Function: minBy()

Returns an iterable containing a minimum value of iterable based on the fn Compare function if iterable contains at least one value. Otherwise, returns an empty iterable.

Example

console.log(
pipe(
[`eating`, `sleeping`, `yawning`],
minBy((a, b) => a.length - b.length),
get,
),
)
//=> eating

Since

v0.0.1

Call Signature

minBy<Value>(fn, iterable): Optional<Value>

Type Parameters

Value

Parameters

fn

Compare<Value>

iterable

Iterable<Value, any, any>

Returns

Optional<Value>

Defined in

statistics.d.ts:360

Call Signature

minBy<Value>(fn): (iterable) => Optional<Value>

Type Parameters

Value

Parameters

fn

Compare<Value>

Returns

Function

Parameters

iterable

Iterable<Value, any, any>

Returns

Optional<Value>

Defined in

statistics.d.ts:360