None of the tests are passing for the roman numeral converter project. Please help

Tell us what’s happening:
Describe your issue in detail here.
even though the answers for all the tests are correct, none of the tests are passing. Please help me with this

  **Your code so far**

function convertToRoman(num) {
let arr=" ";
while(num>0){
 if(num>=1000){
  arr+="M";
  num=num-1000;
}
else if(num>=900){
  arr+="CM";
  num=num-900;
}
else if(num>=500){
  arr+="D";
  num=num-500;
}
else if(num>=400){
  arr+="CD";
  num=num-400;
}
else if(num>=100){
  arr+="C";
  num=num-100;
}
 else if(num>=90){
  arr+="XC";
  num=num-90;
}
else if(num>=50&&num<90){
  arr+="L";
  num=num-50;
}
else if(num>=40){
  arr += "XL";
  num=num-40;
}
else if(num>=10){
  arr+="X";
  num=num-10;
}
else if(num==9){
  arr+="IX";
  num=num-9;
}
else if(num>=5&&num<9){
  arr+="V";
  num=num-5;
}
else if(num==4){
  arr += "IV";
  num=num-4;
}
else if(num<4){
  arr +="I";
  num=num-1;
}
}
return arr;
}

console.log(convertToRoman());
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Challenge: Roman Numeral Converter

Link to the challenge:

In this line you’ve made a little mistake, which messes up the test.

let arr=" ";

Yup, now I got the tests passing. thanks a lot for the help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.