I'm trying to output this function into my ejs file. But I don't know how to access the output variable?
function ejsoutput(json){
var output = json;
};
app.get('/',(req, res, next) => {
res.render('index', { leaderboard: output });
});
CodePudding user response:
You can try something like this. It might work,
var output = null;
function ejsoutput(json){
output = json;
};
app.get('/',(req, res, next) => {
res.render('index', { leaderboard: output });
});