JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">

JavaScript

String.prototype.format = function() {
        var str = this;
        var i = 0;
        var len = arguments.length;
        var matches = str.match(/{}/g);
        if( !matches || matches.length !== len ) {
            throw "wrong number of arguments";
        }
        while( i < len ) {
            str = str.replace(/{}/, arguments[i] );
            i++;
        }
        return str;
    };

bar1 = 'foobar'
bar2 = 'jumped'
bar3 = 'dog'

foo = 'The lazy {} {} over the {}'.format(bar3, bar2, bar1);
    
    alert(foo);