Skip to content
Advertisement

How do you do a for loop/for each in EJS?

I know it has to go inside <% %>, but I’m not sure if it’s very different from a typical forEach/for loop. The documentation on the EJS site is pretty limited, so I came here.

JavaScript

Advertisement

Answer

So here’s the example on embeddedjs:

JavaScript

And here’s what I did:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement