mardi 24 septembre 2019

Decision making with if statement consists of multiple variables in JavaScript

I have four variables. I want to check if all of the four variables equal to 0, then some statements execute. I tried some solutions but none of them worked. How could I solve this problem? Here is my code snippet:

var coun1 = 0;
var coun2 = 0;
var coun3 = 0;
var coun4 = 0;

if(all of the variables equal to 0) {
   //some code here
}

Aucun commentaire:

Enregistrer un commentaire