mardi 31 mars 2020

What would be a optimized statement for ternary operation

I found two of the following operations working same

  1. var x = someValue ? someValue : 1

  2. var x = someValue || 1

what would be the best practice and why ?

Aucun commentaire:

Enregistrer un commentaire