wycats/handlebars.js — Issue #133: Feature request:  built-in "join" helper
Author: jlubean
Created: 2011-10-27 20:01:50+00:00
State: open

I couldn't figure out a way to use a built-in helper to join a list of items with a delimiter. If there is already a built-in helper or combination of built-in helpers that can do this, please let me know. Otherwise, I suggest that you add a built-in helper called "join" that has a parameter for the delimiter.

For example, the template would contain something like this:

{{join myArray delimiter=", "}}

I ended up registering my own helper for my immediate needs:

```javascript
Handlebars.registerHelper("join", function(context, block) {
return context.join(block.hash.delimiter);
});
```

This should be modified to handle cases when context is null, the context is not an array, the delimiter is null, etc.