function formatString(pattern) {
    var args = Array.prototype.slice.call(arguments, 1);
    return pattern.replace(/\{(\d+)\}/g, function (match, number) {
      return typeof args[number] !== 'undefined' ? args[number] : match;
    });
  }
// Formats a string with the provided objects.
Formats a string with the provided objects.
Formats a string with the provided objects .
function formatString(pattern) {
    var args = Array.prototype.slice.call(arguments, 1);
    return pattern.replace(/\{(\d+)\}/g, function (match, number) {
      return typeof args[number] !== 'undefined' ? args[number] : match;
    });
  }
function formatString ( pattern ) { var args = Array . prototype . slice . call ( arguments , 1 ) ; return pattern . replace ( / \{(\d+)\} / g , function ( match , number ) { return typeof args [ number ] !== 'undefined' ? args [ number ] : match ; } ) ; }
Formats a string with the provided objects.
Formats a string with the provided objects .