String.prototype.format = function() { if(arguments.length === 0) return this; var obj = arguments[0]; var s = this; for(var key in obj) { s = s.replace(new RegExp("\\{\\{" + key + "\\}\\}", "g"), obj[key]); } return s; };
String.prototype.format = function() { if(arguments.length === 0) return this; var obj = arguments[0]; var s = this; for(var key in obj) { s = s.replace(new RegExp("\\{\\{" + key + "\\}\\}", "g"), obj[key]); } return s; };