'changing value in received case it get the right result but when i put zero its doing nothing

If I am putting value in received cases 0 then its not giving any value no subtraction performing

let _variance = _receivedCases - _requestedCases;
 
document.getElementById("Variance_" + index).innerText = _variance;
if(_variance === 0){
   $("#Variance_" + index).parent().removeClass("text-danger");
}
else{
   $("#Variance_" + index).parent().addClass("text-danger");
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source