mercredi 19 juin 2019

Shorter Comparison in JS and other Languages

I was wondering if i could write this

if ( (a > b) == (a > c) ) { ...

instead of this

if ( (a > b) && (a > c) ) || ( (a < b) && (a < c) ) { ...

a, b and c are numbers

Aucun commentaire:

Enregistrer un commentaire