This question already has an answer here:
Are there any shorthands for combination of multiple AND and OR expressions in IF-statements by JavaScript?
I was wondering about any shorthands available when I need to write this:
if( ( w === 'bg' || w === 'c' ) && ( v.length === 3 || v.length === 4 || v.length === 6 || v.length === 8 ) ){
// do something
};
Aucun commentaire:
Enregistrer un commentaire