const toRoman = (numeral) => new Array(numeral + 1) .join('I') .replaceAll('IIIII', 'V') .replaceAll('VV', 'X') .replaceAll('XXXXX', 'L') .replaceAll('LL', 'C') .replaceAll('CCCCC', 'D') .replaceAll('DD', 'M') .replaceAll('IIII', 'IV') .replaceAll('VIV', 'IX') .replaceAll('XXXX', 'XL') .replaceAll('LXL', 'XC') .replaceAll('CCCC', 'CD') .replaceAll('DCD', 'CM'); toRoman(2020); toRoman(1999);