Function dropRight

  • It will create a slice of value (array/string) with n elements dropped from the end.

    Type Parameters

    • Value extends string | unknown[]

    Parameters

    • value: Value
    • n: number = 1

    Returns Value

    Since

    1.0.0

    Example

    drop([0, 1, 2, 3, 4, 5], 2);
    // => [0, 1, 2, 3]

    Example

    drop("012345");
    // => "01234"

    Example

    drop("012345", 2);
    // => "0123"