I am struggling how to create a flag in nodejs. Please refer to small code below to get my idea
var isLogged = "no"
function login(){
this.isLogged = "yes"
}
function sendText(){
if(this.isLogged == "yes"){
console.log("Hello World")
}
}
In nodeJS, variable seems not to support this. Please advice me how to do it. Thanks