Tell us what’s happening:
Describe your issue in detail here.
hello,
when i run the test it get me that i have wrong output i mean (X sign ) that means it is worng
i console.log every output in each case and i am getting the write answer but some how it doesn’t work when i run the test
**Your code so far**
let final = [];
function convertToRoman(num) {
if(num <1){
return ;
}
let arr = [1000,900,500,400,100,90,50,40,10,9,5,4,1];
let x = {
1:'I',
4:'IV',
5:'V',
9:'IX',
10:'X',
40: 'XL',
50:'L',
90: 'XC',
100:'C',
400: 'CD',
500:'D',
900: 'CM',
1000:'M'
};
let theBaseNumber = arr.find(a=> a<num || a == num);
final.push(x[theBaseNumber]);
convertToRoman(num-theBaseNumber);
return final.join('');
}
convertToRoman(649);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Challenge: Roman Numeral Converter
Link to the challenge: