jeudi 8 novembre 2018

If else condition combine && and || in one row statement

Thank you for your time, i create some if else statement in checkbox to display result, can i combine && and || condition in one statement? for example

if (radioMale && chestPain && (leftArm || both arm || jaw || throat)) {
highPossibilityOfHeartDisease = true;
}

User have to tick radioMale && chest pain && can tick either leftArm, bothArm, jaw or throat (one or more) to return true for highPossibilityOfHeartDisease. Is the code above valid? need some help here.

Aucun commentaire:

Enregistrer un commentaire