Here you can find the source of ljust( width, padding )
String.prototype.ljust = function( width, padding ) { padding = padding || " "; padding = padding.substr( 0, 1 );/*from w ww . jav a2s . c o m*/ if( this.length < width ) return this + padding.repeat( width - this.length ); else return this.toString(); }
String.prototype.ljust = function( length, char ) { var fill = []; while ( fill.length + this.length < length ) { [fill.length] = char; return this + fill.join('');
String.prototype.rjust = function( length, char ) { var fill = []; while ( fill.length + this.length < length ) { fill[fill.length] = char; return fill.join('') + this;
String.prototype.rjust = function( width, padding ) { padding = padding || " "; padding = padding.substr( 0, 1 ); if( this.length < width ) return padding.repeat( width - this.length ) + this; else return this.toString(); };
String.prototype.rjust = function( width, padding ) { padding = padding || " "; padding = padding.substr( 0, 1 ); if( this.length < width ) return padding.repeat( width - this.length ) + this; else return this;
String.prototype.rjust = function (length, padding) { var paddedString = this.slice(); while (paddedString.length < length) { paddedString = padding + paddedString; return paddedString; }; function setDefaultInputDate (dateInputSelector) { var input = $(dateInputSelector); ...