Answer the question
In order to leave comments, you need to log in
Checking in Pug/Jade?
Hey! The question is this:
- In pug, from the json file, in which the array of objects is located, data is pulled into certain tags. Is it possible to check if there is a given key in the object - display the tag along with the data, if there is no key in the object - do not display the tag?
Answer the question
In order to leave comments, you need to log in
Solved
- var anchor = data.anchor
- if (anchor !== undefined)
a(href='http://' + anchor)= anchor
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question