This question already has an answer here:
i want to know if there is a shorter way of writing or || statements like this
if (driver.name === 'test' || driver.name === 'test2'){
//do some stuff
}
Rather than repeating driver.name twice is there i way i can use it once and check for 2 different values for this object property
Aucun commentaire:
Enregistrer un commentaire