String.interpolate()
Here’s a string prototype that allows you to interpolate variables into a string (ruby style). All you have to do is create your template and call interpolate on it ( with an object literal as a parameter for the vars to interpolate ).
Example:
var template = “The #{foxAdj}, #{foxAdj2} fox jumped over the #{dogAdj} dog.”;
// alert [...]