Here you can find the source of format()
String.prototype.format = function() { var formatted = this; for (var arg in arguments) { formatted = formatted.replace("{" + arg + "}", arguments[arg]); }//from ww w .ja v a 2s. c om return formatted; }; $(document).on("click", "input.click-select", function(e) { $(e.target).select(); });
'use strict'; String.prototype.format = function () { var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) { if (typeof args[number] !== 'undefined') { return args[number]; } else { return match; }); };
String.prototype.format = function() { var pattern = /\{\d+\}/g; var args = arguments; return this.replace(pattern,function(capture){return args[capture.match(/\d+/)];}); var getRandomInt = function(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };
String.prototype.format=function(){ var args = arguments; return this.replace(/{(\d+)}/g, function(match, number){return typeof args[number] != 'undefined'?args[number]:match;}); };
String.prototype.format = function () { var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) { return args[number] != undefined ? args[number] : match; }); };
'use strict'; String.prototype.format = function(){ var args = arguments; return this.replace(/{(\d+)}/g, function(match, index){ return args[index]; }); }; module.exports = String;
"use strict"; String.prototype.format = function () { var args = arguments; return this.replace(/\{(\d+)\}/g, function () { return args[arguments[1]]; }); };
String.prototype.format = function() { var pattern = /\{\d+\}/g; var args = arguments; return this.replace(pattern, function(capture){return args[capture.match(/\d+/)]});
String.prototype.format = function () { var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match ; }); }; ...
function $log(text, obj) { if (window.console && console.log) { console.log(text); if (obj) { console.log(obj); String.prototype.format = function () { ...