How can I repeat a multidimensional array with Jade template lang

I am wondering if it is possible to iterate a multidimensional array in Node.js. I am returning an array that has an object inside it, and I put it in an array so that I can click on it, but when all this is done, I am left with something like

[ [ { stuff: stuff } ], [ { stuff: stuff } ] ] 

I tried

 each item in items p= item 

which returns [object Object]

When i try

 each item in items p= item.invdescription 

I get an error message, any idea how I can do this with jade? Thanks!

Basically:

 for (var i = 0; i < items.length; i += 1) { p= items[0][i].invdescription } 
+7
source share
1 answer

if items matter

 [ [ { stuff: stuff } ], [ { stuff: stuff } ] ] 

then you can iterate over the values โ€‹โ€‹of stuff in jade through

 each item in items p #{item[0].stuff} 
+7
source

All Articles