Function closest

  • Returns the closest value to x from xs.

    If xs is empty then x is returned as is.

    Parameters

    Returns Mapper<number>

    closest([0, 3, 6])(1.8);
    // ⮕ 3
MMNEPVFCICPMFPCPTTAAATR