Javascript String padLeft(n, str)

Description

Javascript String padLeft(n, str)

String.prototype.padLeft = function(n, str) {
  return Array(n - String(this).length + 1).join(str || '0') + this;
}



PreviousNext

Related