Posts by Filipe Botelho • 21 points
1 post
-
2
votes5
answers16703
viewsA: Fill left zeros in Javascript
I believe that already resolves: const n = '1236' (n.slice(0, -1) + '-' + n.slice(-1)).padStart(7, '0') For a more detailed example: const inputNumber = document.getElementById('number')…