Use for loop in Pug template
Question:
How to use for loop in Pug template? Answer:
ul
- for (let i = 1; i <= 10; i++) {
li #{i}
- }
Description:
Pug supports two primary methods of iteration: each
and while
. You can also use for
as an alias of each
.
Reference:
Pug iteration reference
Share "How to use for loop in Pug template?"
Related snippets:
Tags:
pug, iteration, loop, for, each, template, express Technical term:
Use for loop in Pug template