Okay basically I made some switch/case statements that push a numeral into an array that i’ll eventually join but the array is returning empty. I know there’s a better way to do this but I genuinely can’t figure it out. Any help would be appreciated.

```
function convertToRoman(num) {
let romanArr = [];
let regex = /\d/g
let numArr = "".concat(num).match(regex)
numArr = numArr.map((num) => parseInt(num))
while (numArr.length < 4) {
numArr.unshift(0)
}
for (let i = 0; i < numArr.length; i++) {
let number = numArr[i] * 10 ** (i + 1)
switch (number) {
case 0 < number < 10000:
romanArr.push("M" * (number / 1000))
case 0 < number < 1000:
switch (number) {
case number === 900:
romanArr.push("CM")
case number === 400:
romanArr.push("CD")
case 400 < number <= 800:
romanArr.push("D".concat("C" * (number / 100) - 5))
case number < 400:
romanArr.push("C" * (number / 100))
}
case 0 < number < 100:
switch (number) {
case number === 90:
romanArr.push("XC")
case number === 40:
romanArr.push("XL")
case 40 < number <= 80:
romanArr.push("L" + ("X" * (number / 10) - 5))
case number < 40:
romanArr.push("X" * number)
}
case 0 < number <= 9:
switch (number) {
case number === 9:
romanArr.push("IX")
case number === 4:
romanArr.push("IV")
case number < 4:
romanArr.push("I" * number)
case 4 < number <= 8:
romanArr.push("V" + ("I" * (number - 5)))
}
}
}
return romanArr
}
convertToRoman(500)
```

```
**Your browser information:**
```

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

**Challenge:** Roman Numeral Converter

**Link to the challenge:**