Iterate over javascript object in pug
问题 I've seen a few of these questions but the answers never seem to be clear cut. I need to iterate through a javascript object in my pug view. First time using pug, so I may be missing something obvious. Controller: app.get('/search/:keyword', (req, res) => { scraper .searchDictionary(req.params.keyword) .then(words => { res.render('result', console.log(words)) }); }) Here is the actual function that makes the object: function searchDictionary(searchTerm){ const url = `https://www.dictionary