I completed the Roman Numeral Converted. However, I’m still wondering if there is a short way to call the Roman Numbers like with the Binary numbers? I did my best with the code, however, I still have the big Object “Codes”
function convertToRoman(num) {
var Codes = [["","I","II","III","IV","V","VI","VII","VIII","IX"],["","X","XX","XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"],["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM",], ["","M","MM","MMM"]];
return(num.toString().split("").reverse().map((x,y)=>Codes[y++][x]).reverse().join(""))
}
convertToRoman(2620);