Last Updated: February 25, 2016
·
1.313K
· rogeriolino

Javascript zero fill

var length = 5;
var number = 15;
new Array(length - number.toString().length + 1).join('0') + number;