javascript has no built-in function to formatting strings, like c# string.Format(). This function solves the issue adding missing functionality.
In order to recognize string objects you should add a property to String prototype. You can find it in the code below isString. The usage of the function looks like this: “text {0}-{1}”.format(“blah1”, “blah2”) => “text blah1-blah2”