index.js
function pad(value, length) {
  value = String(value);
  length = length || 2;

  while (value.length < length) {
    value = '0' + value;
  }

  return value;
}
function pad(value, length) {
  value = String(value);
  length = length || 2;

  while (value.length < length) {
    value = '0' + value;
  }

  return value;
}
function pad ( value , length ) { value = String ( value ) ; length = length || 2 ; while ( value . length < length ) { value = '0' + value ; } return value ; }
Pad 'value' with zeros up to desired 'length'
@param {String|Number} value
@param {Number} [length]
@returns {String}
Pad value with zeros up to desired length