I get a pretty dumb error in an extremely simple express application. I use jade as a viewer, I say this just in case this is due to a problem.
I am trying to check if a variable is defined to visualize an object, but just checking this variable causes "variable not defined". Error. This is not the behavior that I expect, so I'm curious that I'm doing something wrong. This is the view code I'm using:
h1= title - if (user) p Welcome to #{title}, #{user.username} - else p Welcome to #{title}
What is the right way to do this? There should be a way to check the variables on the views .: - /
EDIT: Forgot to say in which line the error is triggered, it is triggered in the second line "- if (user)".
source share