mercredi 2 janvier 2019

Can I Simplify This IF Statement?

I have two variables AddToCart and SearchTerms, and I am checking to see if they are valid before proceeding with my script...

This is my code

if(typeof AddToCart !== 'undefined' || AddToCart !== null && SearchTerms !== 'undefined' || SearchTerms !== null) {

Is there a way to make this IF statement a bit more readable, or am I stuck with what I have written?

Aucun commentaire:

Enregistrer un commentaire