Z
Z
zwezew2018-06-01 16:56:09
JavaScript
zwezew, 2018-06-01 16:56:09

How to set an array in pug jade using if?

How to set an array in pug jade using if?
There is a basic view template

- var x = 4;
- var num = ["1", "2", "3", "4"];
- var text = ["a", "b", "c", "d"]

- for (var i = 1; i <= x; i++) {
                div(class='class' + i)=  num[i]
                            
                include menu-1
 - }

There are 4 menu blocks in total, the items change in the array
- var link = ['menu 1, 'menu 2']
- var link2 = ['menu 3, 'menu 4'
] include menu-1 ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question