> My favorite topics: {{#topics}} {{.}}, {{/topics}}
>
> The comma will also be inserted after the last element
>
> Does Mustache provide a way to resolve this ?
It's not built in.
Google's CTemplate (which Mustache is based on) supports this:
Here are the meeting attendees:
{{#ATTENDEES}}
{{NAME}}
{{#ATTENDEES_separator}}, {{/ATTENDEES_separator}}
{{/ATTENDEES}}
.
But in Mustache I've just been adding that logic to the View:
My favorite topics: {{#topics}} {{.}}{{^last_topic?}},{{/last_topic?}}
{{/topics}}
This might be more difficult in mustache.js though.