Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 290 Bytes

pad-strings.md

File metadata and controls

10 lines (7 loc) · 290 Bytes

Pad strings with padstart

To pad a string to a given length with a character, use padStart.

let month = '5';
let paddedMonth = month.padStart(2, '0');

See the documentation.