Is it a good practice to use the ternary operator for this:
answersCounter = answer.length != 0 ? ++answersCounter : answersCounter;
This is a question that I always asked myself as it happens quite often. Or is it better to use a normal if statement. For me this looks much cleaner in one line.
Aucun commentaire:
Enregistrer un commentaire