My notes on programming.
var format = function (input) { var args = arguments; return input.replace(/\{(\d+)\}/g, function (match, capture) { return args[1*capture + 1]; });