We have a piece of code that uses a conditional operator to compare the value of the variable x to 5:
(x >=5 ? x : -x)
Can this be used like an if else on all accounts? For example, can you compare strings with it?
(x =="Cheese" ? x : -x)
Aucun commentaire:
Enregistrer un commentaire