Get the name of a number, even if it's stupidly big.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

16 řádky
390 B

  1. import { Digit } from '../../../common'
  2. import NAMES from '../names'
  3. interface TenPlus {
  4. (ones: Digit): string
  5. }
  6. /**
  7. * Get the name of some number plus ten.
  8. * @param {number} x1 - The number in the ones place.
  9. * @returns {string} The name of the number plus ten.
  10. */
  11. const tenPlus: TenPlus = (x1) => (Number(x1) === 0 ? NAMES.tenTimes[1] : NAMES.tenPlus[x1])
  12. export default tenPlus