Seems like the logical way to do it. Though, honestly, unless you specifically need to do lots of different kinds of padding, something like this makes way more sense:
const bespokePad = (x) => ('000000' + x).slice(-6)
const bespokePad = (x) => ('000000' + x).slice(-6)
No comments yet.