JsRender: Custom helper functions for computed parameters

TitleLanguages

HTML:

<td>
    {{for languages}}
        {{>name}}
        {{if ~nextToLast()}}
            and
        {{else ~notLast()}}
            ,
        {{/if}}
    {{/for}}
</td>

Script:

$.views.helpers({

    nextToLast: function() {
        var view = this;
        return view.index === view.parent.data.length - 2;
    },

    notLast: function() {
        var view = this;
        return view.index !== view.parent.data.length - 1;
    }
});