home ~ projects ~ socials

Add Leading Zeros To A String In JavaScript

const startString = '42'
const newString = startString.padStart(4, '0')
-- end of line --