Here's what I need help with: I have an array with the following values,
{"OPN":0,"INPR":8,"WAIT":2,"STP":1,"RED":13}
I need to show a modal window if all keys have a count of 0, except for WAIT. If the count of all keys is greater than 0, then I need to display a different modal window. I attempted the code below, but it's not working as expected because both modal windows are being shown.
for (let index = 0; index < this.status.length; index++) {
if(this.status[index] != 'WAIT' && this.countOfStatus[this.status[index]] > 0){
$("#modal1").modal("show");
break;
}else{
dummyVar = true;
}
}
if(dummyVar){
$("#modal2").modal("show");
}
Any assistance on this matter would be greatly appreciated.
Thank you in advance.