lundi 28 août 2017

If statement issue enter [duplicate]

This question already has an answer here:

I have this JS var, followed by this if statement :

if ($('custom_t4'))
                var contratType = $('custom_t4').value === 'Nouvelle_affaire' ? 'Nouvelle Affaire' : $('custom_t4').value === 'Avenant' ? 'Avenant' : '';



if (contratType && (contratType !== 'Nouvelle Affaire' || contratType !== 'Avenant')){ }

The problem I have, is that when contratType is defined and his value is 'Nouvelle Affaire', is still enter that if.

Did I miss something ?

Aucun commentaire:

Enregistrer un commentaire