What condition is false in a multiple conditions if statement
I'm writing a multiple if statement in Javascript. I've 3 (or more) conditions, and I wanna doSomething() only if all these 3 conditions are true. If only one of these 3 are false, I wanna doSomethingElse(). I think my code it's right, but my problem is on another level. What if I wanna know for which condition my statement is false? E.g.: condition1=true, condition2=true, condition3=false. if (condition1 && condition2 && condition3) { doSomething(); } else { doSomethingElse(); }; I've thought that I can put another if statement in the else part. if (condition1 && condition2 && condition3) {