JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.8.1/mustache.min.js"></script>
<div id="output">
</div>

JavaScript

var data = {
    "items": [
        {"display": "Item 1"},
        {"display": "Item 2"},
        {"display": "Item 3"},
        {"display": "Item 4"}
    ],
    "trim": function () {
        return function (text, render) {
            // trim trailing comma and whitespace 
            return render(text).replace(/(,\s*$)/g, ''); 
        }
    }
};

var template = "{{#trim}}{{#items}}{{display}}, {{/items}}{{/trim}}";

$(function () {
    $("#output").html(Mustache.render(template, data));
});