- Instant help with your JavaScript coding problems

Iterate over an array in a Pug template

Question:
How to iterate over an array in a Pug template?
Answer:
div 
    each p in products
        h1 #{p.title}
Description:

Use each template method to iterate over an array in a Pug template. The array to iterate over is just a plain JavaScript array.

Share "How to iterate over an array in a Pug template?"
Tags:
iterate over an array, array iteration, loop through an array, array, collection, list
Technical term:
Iterate over an array in a Pug template