title: Javascript equivalent to python's .format()
body: <p>I would like a javascript function that mimics the python .format() function that works like</p>
  
  <pre><code>.format(*args, **kwargs)
  </code></pre>
  
  <p>A previous question gives a possible (but not complete) solution for '.format(*args)</p>
  
  <p><a href="https://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format">JavaScript equivalent to printf/string.format</a></p>
  
  <p>I would like to be able to do</p>
  
  <pre><code>"hello {} and {}".format("you", "bob"
  ==&gt; hello you and bob
  
  "hello {0} and {1}".format("you", "bob")
  ==&gt; hello you and bob
  
  "hello {0} and {1} and {a}".format("you", "bob",a="mary")
  ==&gt; hello you and bob and mary
  
  "hello {0} and {1} and {a} and {2}".format("you", "bob","jill",a="mary")
  ==&gt; hello you and bob and mary and jill
  </code></pre>
  
  <p>I realize that's a tall order, but maybe somewhere out there is a complete (or at least partial) solution that includes keyword arguments as well.</p>
  
  <p>Oh, and I hear AJAX and JQuery possibly have methods for this, but I would like to be able to do it without all that overhead.</p>
  
  <p>In particular, I would like to be able to use it with a script for a google doc.</p>
  
  <p>Thanks</p>