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.
Reference:
Pug iteration reference
Share "How to iterate over an array in a Pug template?"
Related snippets:
Tags:
iterate over an array, array iteration, loop through an array, array, collection, list Technical term:
Iterate over an array in a Pug template