String . prototype . format = function ( ... param ) { var args = Array . prototype . slice . call ( arguments ) ; var count = 0 ; return this . replace ( /%s/g , function ( s , i ) { return args [ count ++ ] ; } ) ; } ;