**Hello**

the past two days i tried to solve the Roman Numeral Converter challenge ,

I read about it and understand the numbers and the combinations then on a paper I started to decide

how will I solve that it was nice and clean on **Paper** then I started to turn my ideas into code

here was the problem my code was so complicated that I my self got lost among its lines and it doesn’t work as I expected there is my code

```
function convertToRoman(num) {
var numArr = (num+'').split``.map(x => x/1);
console.log(numArr);
var numericalValueArr = numArr.map((number,index,array)=>{
if(array.length==1){
return number;
}
var slicedArr=array.slice(index,array.length-1).length;
var tenToThePowerOfX= Math.pow(10,slicedArr);
return number*tenToThePowerOfX;
});
console.log(numericalValueArr);
var romanNumerals =[
{
value:1,
symbol:"I"
},
{
value:5,
symbol:"V"
},
{
value:10,
symbol:"X"
},
{
value:50,
symbol:"L"
},
{
value:100,
symbol:"C"
},
{
value:500,
symbol:"D"
},
{
value:1000,
symbol:"M"
}
];
function converter(){
var numericalValue= numericalValueArr.map((num)=>{
for( let[ index,number] of romanNumerals.entries()){
for(let anotherNumber of romanNumerals){
var subtract=num==number.value-anotherNumber.value;
switch(true){
case num==0 :
return null;
break;
case num/number.value==1 :
remains=0;
return number.symbol;
break;
case subtract :
return anotherNumber.symbol+number.symbol;
break;
case remains==0&&num/number.value==2&&num!==number.value :
return number.symbol+number.symbol;
break;
case remains/anotherNumber.value==1&&num!==number.value :
return target.symbol+anotherNumber.symbol;
break;
case remains/anotherNumber.value==2&&num!==number.value :
return target.symbol+anotherNumber.symbol+anotherNumber.symbol;
break;
case remains/anotherNumber.value==3&&num!==4*Math.pow(10,Number) :
return target.symbol+anotherNumber.symbol+anotherNumber.symbol+anotherNumber.symbol;
break;
}
console.log("NUM "+num);
var correctNum= num>10&&num<100 ? 10 :100;
console.log(correctNum);
var remains;
if(num>number.value){
remains = num%number.value;
var target=number;
console.log(remains,number.value);
}
}
}
});
console.log('Roman '+numericalValue.join(''));
}
converter();
}
convertToRoman(200);
```

compare my code to this code you will understand my problem

```
var convertToRoman = function(num) {
var decimalValue = [ 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 ];
var romanNumeral = [ 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I' ];
var romanized = '';
for (var index = 0; index < decimalValue.length; index++) {
while (decimalValue[index] <= num) {
romanized += romanNumeral[index];
num -= decimalValue[index];
}
}
return romanized;
}
// test here
convertToRoman(36);
```

please try to help me on this situation with any advice , thank you