denhamd2
05-22-2012, 09:09 AM
Hi,
I'm banging my head off a brick wall with setting up a 3 dimensional array and trying to loop through it. I'm using the EJS framework (http://embeddedjs.com/).
We currently have a 2D array set up to list out features. See below:
topfeatures: [
"Feature 1",
"Feature 2",
"Feature 3",
"Feature 4",
"Feature 5",
"Feature 6"
]
<ul>
[% for(var i = 0; i < this.topfeatures.length; i++) { %]
<li>[%= this.topfeatures[i] %]</li>
[% } %]
</ul>
However, the request we have requires headlines for each set of features.
Headline 1
Feature1
Feature2
Feature3
Headline 2
Feature4
Feature5
Feature6
Any ideas how I can do this?
I'm banging my head off a brick wall with setting up a 3 dimensional array and trying to loop through it. I'm using the EJS framework (http://embeddedjs.com/).
We currently have a 2D array set up to list out features. See below:
topfeatures: [
"Feature 1",
"Feature 2",
"Feature 3",
"Feature 4",
"Feature 5",
"Feature 6"
]
<ul>
[% for(var i = 0; i < this.topfeatures.length; i++) { %]
<li>[%= this.topfeatures[i] %]</li>
[% } %]
</ul>
However, the request we have requires headlines for each set of features.
Headline 1
Feature1
Feature2
Feature3
Headline 2
Feature4
Feature5
Feature6
Any ideas how I can do this?