function ord(n) {
var sfx = ["th","st","nd","rd"];
var val = n%100;
return n + (sfx[(val-20)%10] || sfx[val] || sfx[0]);
}
The part at the end, (sfx[(val-20)%10] || sfx[val] || sfx[0]); Does this kind of evaluation have a particular name in javascript? Could someone tell me what that is called so I can learn how to use them, trying to figure out how this code works.
THANKS