title: MessageFormat in javascript (parameters in localized UI strings)
body: <p>What is a good way for handling parameters in localized strings in javascript?
  I am using the same format as in java's MessageFormat class, e.g.:</p>
  
  <p><code>There are {0} apples in basket ID {1}.</code></p>
  
  <p>Where <code>{0}</code> will be replaced with the first parameter and <code>{1}</code> with the second.</p>
  
  <p>This is the call I want to use in JS (i.e. I want to implement <code>origStr</code>):</p>
  
  <p><code>var str = replaceParams(origStr, [5, 'AAA']);</code></p>
  
  <p>I am guessing the best strategy would be to use a regular expression. If so, please offer a good regular expression. But I'm open to hear any other options. </p>