W
W
wlms2018-02-19 22:48:03
JavaScript
wlms, 2018-02-19 22:48:03

How to loop through an array in handlebars?

Gentlemen, good day to all. There is a task to sort out JSON in Handlebars.
Structure https://dumpz.org/2732853/

cqC5DaDWmsjMetzxYleXhgdZjTmWZiQNsLsDgtBUlUu2KzBoi_yc4Dvf0hGoHEe06gx8a3q674CnuROr0wgfcIQYIzmR3rjU6Rx3c9BJZSaFJQ4gIY0IRirkVhmfbttc7JWK-Xa4L7EAV4m0Kc3JGX6hoVHLx3DXKHvYuqNGvq1OXYBmlP7WVv8jleSCx8u0F-bJDeEsJ9y37pOpvVWvt7psh31MvLAaHr6TaKYLcdPo0irOOxxOOGs_5-wGPwVBsyfx83DVxyaVdQsFvfYrlAzeO_q_u9vH2x2RnhWq05TzfFqessHDYDOhF2xG5mEasn-7RoTcRBThWOYpjm6UNQ.jpg

It is necessary, it turns out, to output, in a separate block, each object array -> [0], [1] containing arrays with data
I was tormented to look for how to draw a conclusion by indexes.
Did it like this:

{{#each array}}
        {{#each this}}
            {{@index}} {{this}}
        {{/each}}
{{/each}}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-02-19
@smlwmy

Did it like this:
{{#each array}}
        {{#each this}}
            {{@index}} {{this}}
        {{/each}}
{{/each}}

What is array? There is no such property in json. Write this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question