var1 == var2 means "return true if values are equal"
var1 = var2 means "assign value of var2 to var1 and return var2"
So boolName = true will be always equal to true
And it should work when you do just if(boolName), of course assuming boolName is a boolean