lundi 15 juin 2020

Conditional statement not working correctly [duplicate]

Suppose I have 2 variables that are equal to the following

var subTyp = "";
subTypsMatch = true;

I have a conditional If statement to filters these variables:

if (((subTyp != "") || (subTyp != "00000")) && (subTypsMatch != false)) {
    var query2 = new Query();
    var cntyLayer = NjCountiesLayer;
    cntyLayer.visible = false;
    cntyLayer.setDefinitionExpression("");
    query2.where = "CO_FIPS = '" + subTyp + "'";
    cntyLayer.selectFeatures(query2, FeatureLayer.SELECTION_NEW, function (result) {
    ....

} else {
    map.getLayersVisibleAtScale()[1].setLayerDrawingOptions(optionsArray);
    map.getLayersVisibleAtScale()[1].show();
}

In the debugger, I keep going into this conditional, despite variable subTyp = "". What am I doing incorrect here?

Aucun commentaire:

Enregistrer un commentaire