I have two arrays named firstnames and lastnames. The values these two arrays hold are as follows:-
firstnames =[ 'A', 'B', 'C','D','E' ]
lastnames =['a','b','c','d','e']
I am rendering these two arrays to my webpage in the following manner:-
res.render('sample',{firstnames:firstnames,lastnames:lastnames})
Using the #each loop-helper in handlebars, I was able to display the names on the webpage in such a way that all the firstnames appear first followed by all the lastnames by making use of this :-
{{#each firstname}}
<h1>{{this}}</h1>
{{/each}}
{{#each lastname}}
<h1>{{this}}</h1>
{{/each}}
And the output was some thing like:-
A
B
C
D
E
a
b
c
d
e
But, how can I able to display the data in such a way that, each firstname must be followed by the each lastname. Like that of below:-
A
a
B
b
C
c
D
d
E
e