Ran into some weird behavior using underscore.js's template method:
var test = ['first', 'test'];
console.log(_.template('this is a <%= 1 %> ', test));
(Fiddle: http://jsfiddle.net/adamb/mbD6E/)
This snippets outputs: "this is a 1", while the expected result is "this is a test".
No errors are thrown. I've studied the source-code and there's no obvious explanation for this result. It's required that I use interpolation only in my template. I've tried converting the array explicitly to a collection using _.extend({}, test), but no dice.
How can I get this working?