I have this JSON file from which I am extracting a value:
var sta = req.jsonBody.sta //where req.jsonBody.sta = open
So according to this my var sta should be equal to open. Now when I do this:
var turnOn = true
var open = "open"
if (sta == open)
{
turnOn = false
console.log(sta)
}
console.log(turnOn)
The value of turnOn
should be false but my console is printing true
. I don't now where i am wrong.