function wordend(num, words){ if((num=Math.abs(num%100)) > 20) num%=10; return words[ (num > 4 || num === 0) + (num !== 1) ]; }