dimanche 27 mars 2016

if else statement reverse

the result I want is second if else statement if code not in the list then alert, I don't get why the first if else statement fail, I thought that just reverse second if else statement ?? do I misunderstand some thing??

http://ift.tt/22EomlN

var code = '500';

    if (code != '400' || code != '401' || code != '500') {
        console.log('true');  // I don't want it alert here
    }
    
    
    if (code == '400' || code == '401' || code == '500') {      
      // I have to always leave this empty line  ...
    } else {
    console.log('second true');
    }

Aucun commentaire:

Enregistrer un commentaire