Since node, I have something like this:
var nombres = ['Saab','Volvo','BMW'];
app.get('/', function(req, res){
res.render('index', {nombres: nombres});
});
then in pug:
- var nombres1 = {nombres};
html(lang="es")
head
title= "Itris INFO"
body
script.
console.log(!{JSON.stringify(nombres1)});
ul
each nombre in nombres1
li= nombre
But when you render, in the html it shows me:
- Saab, Volvo, BMW
And the idea is to show something like this:
-
Saab
-
Volvo
-
BMW
I tried all the options they say in other posts about this and nothing works. I added the script tag in order to see the object in the console, and there it shows me an array of 3 elements. However, when I use it in pug it does not work ... I do not know if it takes as a string or that ...