I am trying to créate a function who have a variable in atribute, if the var exists return the variable else return the var name
app.locals.test = function(myvar){
if ( typeof(myvar) != "undefined" ) {
return myvar
}
return 'false'
}
I have no problem il the var is defined but fi the var is no defined I have testVar is not defined. And I don’t haw to get the var name
Thanks for your help
But I can’t get the var name with javascript