Answer the question
In order to leave comments, you need to log in
How to set a loop in jade with a repetition of no more than, for example, 5 times?
I'm a little familiar with cycles in js, but I'm still confused in jade. Here I sit - stupid.
It is necessary to me, means, to deduce the list from 5 elements. At the moment, I just form a list like this:
ul
- each subitem in item.items
li
a(href="#" title="#{subitem.name}")
| !{subitem.name}
Answer the question
In order to leave comments, you need to log in
ul
- each subitem in item.items.slice(0,5)
li
a(href="#" title="#{subitem.name}")
| !{subitem.name}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question