According to underscore's documentation, it allows you to do string template/interpolation like below:
var compiled = _.template("hello: <%= name %>");
compiled({name: 'moe'});
// => "hello: moe"
Instead of using variable symbol like "name", I wonder if there is any way to use integer as the key? For example:
var compiled = _.template("hello: <%= 1 %>");
compiled({"1": 'moe'});
// => "hello: moe"
I gave it a try but underscorejs template evaluates it as a literal instead of variable, is there any way to do templating with underscore if the provided variable contains such integer key in it? Thanks.