This is probably a stupid question, but in Express, when you define local variables in res.render(view, {variable: variable})
, how are they accessed on the frontend? Where are they kept? When I try to access a variable I defined through this method with console.log(variable)
Firebug throws an error saying that variable
is not defined. I also tried console.log(window.variable)
, with similar results. So where are these variables kept?
Also, are res.locals
variables kept in the same place, or are they just thrown out? These variables are accessible to templating engines like swig
and jade
, but I could not find them using console.log()
either.