Function leftPadMin

  • Adds the padWith until the string length matches the length

    Parameters

    • str: string
    • length: number
    • padWith: string = ' '
      const padded = leftPadMin("1", 3, ".");

      console.log(padded); // '..1'

    Returns string