lundi 14 décembre 2020

nodejs: if condiiton in pug

I am going bonkers over a simple if-condition in pug, which i am new to.

If i do this:

if(3 > 2)
 span(class="col s10") Some Label

it works fine and I can see the Some Label, but if i do:

if(mainObject.valOne > Object.keys(mainObject.someDict).length)
 span(class="col s10") Some Label

I cant see the Some Label. I have verified that the value in the mainObject.valOne is 5 and cant seem to understand how to see the length of the dict (which is expected to be less than 5).

Aucun commentaire:

Enregistrer un commentaire