I just finished the roman numeral convertor challenge, and I wanted to see if there is any ways to improve. What do y’all think?

```
function convertToRoman(num) {
const chart = {
M: 1000,
CM: 900,
D: 500,
CD: 400,
C: 100,
XC: 90,
L: 50,
XL: 40,
X: 10,
IX: 9,
V: 5,
IV: 4,
I: 1
};
let remainder = num;
const numeralCounts = {};
// for each numeral type, check how much you can
// remove and keep track of that amount
for (const numeral in chart) {
// modulo (%) returns the remainder of two values in a
// division, for example 3 % 2 = 1
// since two goes into three once, leaving 1 left over.
// this can be used to check if a given numeral can be
// removed from the number
let tempRemainder = remainder % chart[numeral];
if (tempRemainder === remainder) {
console.log(`Cannot remove ${chart[numeral]} from ${remainder}\n`)
continue;
};
// check how many of the numeral you can remove
let count = Math.trunc(remainder / chart[numeral]);
remainder = tempRemainder;
numeralCounts[numeral] = count;
console.log(`Amount of ${chart[numeral]}: ${numeralCounts[numeral]}\n`)
}
// assemble the answer
let answer = ""
for (const numeral in numeralCounts) {
let count = numeralCounts[numeral];
while (count > 0) {
answer += numeral;
count--;
console.log(answer);
}
}
return answer;
}
convertToRoman(36);
```

EDIT: We have blurred this solution (with `[spoiler][/spoiler]`

tags) so that users who have not completed this challenge can read the discussion in this thread without giving away the solution.