Javascript String padLeft(character, length)
'use strict';//from www. j a va 2 s .c o m String.prototype.padLeft = function (character, length) { return character.repeat(Math.max(0, length - this.length)) + this; };