Iterate through an array inside js on pug

Viewed 49

The thing is that I have an array on my route .js file and I need to iterate through it in pug's JS script.

It is a script of chart.js inside pug.js and i need to iterate the route's loop inside it. Of course

Each val in blabla

does not work.

any ideas? Maybbe I am doing it all wrong? Maybe I should just include the route file in a third JS file and make the chartjs there and then link this seperate file in the main pug one?

thanks!

1 Answers

each in are supported to work.

for example:

each val, index in ['zero', 'one', 'two']
    li= index + ': ' + val   
Related