Pads a string or number with a leading fill character to reach a specified length.
The input value to pad
The target length (default: 2)
Optional
The fill character (default: space for strings, zero for numbers)
The left-padded string
pad(5, 2); // '05' Copy
pad(5, 2); // '05'
Pads a string or number with a leading fill character to reach a specified length.