Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access values using {{#each}} in a one dimensional array

I've found a lot of examples of using the {{#each}} helper to iterate over multi-dimensional arrays, but I can't figure out how to access each value in a one-dimensional array.

For example, take this array:

skills: ['Design', 'Development', 'HTML5', 'CSS', 'JavaScript'], 

How do I output each item, in a helper like below?

template: Handlebars.compile( '<div>' +      '{{#each skills}} {{ the_item_output }} {{/each}}' + '</div>' ), 

What do I need to put in placed of {{ the_item_output }} to see the actual item?

like image 653
shrewdbeans Avatar asked Feb 16 '14 17:02

shrewdbeans


People also ask

How do you get a value from a nested dictionary Python?

Access Values using get() Another way to access value(s) in a nested dictionary ( employees ) is to use the dict. get() method. This method returns the value for a specified key. If the specified key does not exist, the get() method returns None (preventing a KeyError ).


1 Answers

{{#each skills}}   <li>{{this}}</li> {{/each}} 
like image 125
alexdd55 Avatar answered Oct 14 '22 20:10

alexdd55