I have following values and the condition.
While checking condition in else if statement it always returns true
var val1 = 8;
var val2 = 10;
if (val1 == "" || val1 == null) {
error = true;
} else if (val1 > val2) {
error = true;
} else {
error = false;
}
console.log(error);
It's returning true, while it must return false
Aucun commentaire:
Enregistrer un commentaire