Adds the padWith (default ' ') to the string the amount of times specified by the space argument
padWith
' '
space
String to add padding to
Whitespace to add
Character to use to pad the string
const padded = leftPad("Hello", 3, ".");console.log(padded); // '...Hello' Copy
const padded = leftPad("Hello", 3, ".");console.log(padded); // '...Hello'
Adds the
padWith
(default' '
) to the string the amount of times specified by thespace
argument