Comma-Separated Lists with JsRender

JsRender is a solid tool, but the documentation is a bit lacking at present. I had a need a while back to render a list of things separated by commas, but without a comma at the beginning or end. That seems like a simple enough task, but it wasn’t obvious to me what the syntax should be. This post helped me figure it out.

Here’s the code (modified for the sake of example):

{{for products}}
    {{if (#index+1) !=}}, {{/if}}

(If you’ve got a better way, drop me a line!)