Using String.prototype.padStart()
const n = 1; String(n).padStart(5, '0'); // '00001'
some text here explaining what Millefeuille does