Skip to content

Instantly share code, notes, and snippets.

@lamnd
lamnd / sprintf.js
Created November 29, 2019 03:07 — forked from rmariuzzo/sprintf.js
Simple and minimal `sprintf` function in JavaScript.
function sprintf(format) {
var args = Array.prototype.slice.call(arguments, 1);
var i = 0;
return format.replace(/%s/g, function() {
return args[i++];
});
}