I have incoming JSON:
[{"key":"browser","value":"Chrome"}, {"key":"geo","value":"false"},{"key":"os","value":"MacOS"}]
And I have to display this by using Handlebars template. I can't use the construction below because **sometimes I have only 2 objects inside JSON:**
Backbone Model
attr.browser = attr[0];
attr.geo = attr[1];
attr.os = attr[2];
Handlebars template:
<ul>
{{#if browser}}
<li>{{browser.key}}</li>
<li>{{browser.value}}</li>
{{/if}}
{{#if geo}}
<li>{{geo.key}}</li>
<li>{{geo.value}}</li>
{{/if}}
{{#if os}}
<li>{{os.key}}</li>
<li>{{os.value}}</li>
{{/if}}
</ul>