Javascript String pad(ch, n)

Description

Javascript String pad(ch, n)

String.prototype.pad = function (ch, n) {
  return n>this.length ? Array(n-this.length+1).join(ch) + this : this.valueOf();
}



PreviousNext

Related