**Tell us what’s happening:**

Inside `for `

loop the variable `numerals`

= IIIIII at `i=0`

, after that they have used replacing, I understand when it goes inside `if`

`IIIIII`

changes to `VI`

, after that i don’t understand anything.

Can anyone help me with what those two `replace function `

doing ?

**Your code so far**

```
function convertToRoman(num) {
let romanArr=[["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"]];
let romanNumeral="";
let strNum=num.toString();
let count=0;
let replaceFromArr;
for(let i=strNum.length-1;i>=0;i--){
replaceFromArr=parseInt(strNum[i]);
if(replaceFromArr!==0){
let romanStr=romanArr[count][replaceFromArr-1]
romanNumeral=romanStr+romanNumeral;
}
count++
}
return romanNumeral;
}
console.log(convertToRoman(3999));
```

**Your browser information:**

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

.

**Challenge:** Roman Numeral Converter

**Link to the challenge:**