• FillS the array with the given value until the array reaches the specified size

    Example

    pad([1, 2, 3], 5, 0); // [1, 2, 3, 0, 0]
    

    Example

    pad([1, 2, 3], -5, 0); // [0, 0, 1, 2, 3]
    

    Type Parameters

    • T

    Parameters

    • arr: T[]
    • size: number
    • Optional value: T = ...

    Returns T[]

Generated using TypeDoc