Courses / JavaScript
48. String.prototype.padStart()
Pads the current string with another string (the second argument) until the resulting string reaches the given length.
1 min read Chapter 48 of 99
JavaScript
String.prototype.padStart()
padStart() allows you to add characters to the beginning of a string until it reaches a specified length.
"I want my string to always look neat and have the same length."
The `padStart()` method pads the current string with another string until the resulting string reaches the given length, aligning it to the start.
"I want my string to always look neat and have the same length."
The `padStart()` method pads the current string with another string until the resulting string reaches the given length, aligning it to the start.