Gravatar for undefined
8 Likes

pad a string to the left.

pad a string to the left.

Example

 leftPad('foo', 5) // => "  foo"
 leftPad('foobar', 6) // => "foobar"
 leftPad(1, 2, '0') // => "01"
`

Test Summary

#leftPad() should pad string `foo` to a total char size of 5Pass
#leftPad() should not pad string `foobar` any char as 6 is the original str lengthPass
#leftPad() should pad string `1` with one 0Pass