mardi 23 mai 2017

Combining and/ or operator in JS (jQuery) with if/else statement

I am having issues in combining && and || operators together in a jQuery if/else statement. Here is an example

if(($x == 'on') && ($y !== 'on' || $z !== 'on')){

// it does not seem to work

}

However, if I place only one of them, it works. Example

if($x == 'on' && $y !== 'on' ){

// it works but I want to combine more like the above 
}

Aucun commentaire:

Enregistrer un commentaire