Is there a short way to test if a variable is equal to two string, in plain JS5?
My code is like:
var type = 'display'
if (type === 'display' || type === 'filter') { ... }
Is there a way to make shorter, like:
if ( type === ('display' || 'filter') ) { ... }
Aucun commentaire:
Enregistrer un commentaire