Roman Numeral Converter algorithm challenges

Tell us what’s happening:
I tried to have a go at this challenge earlier but couldn’t solve it. Now I came back and looked at the hints and I’m not sure if I understand the advice they give.

Hint #1: I get that I would want an array of Roman Numerals as this would be the array that I would join together with the .join() method and I would return this. The second array they say to create with the decimal equivlents should be the place values of the parameter number?

If my number was 1943
Like this: [1000, 900, 40, 3]

I seriously want to finish these challenges so I can move on to the front-end certifications. I finished the palindrome and casaer’s cipher

Your code so far


function convertToRoman(num) {
 return num;
}

convertToRoman(36);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/roman-numeral-converter

Yeah, that is one way to solve it. Is there a question in there?

Take each value in your decimal array and translate it to the roman number equivalent.

Try something and if you get stuck show us what you’ve done.

I believe the hint was suggesting that you have one array of Roman numerals and another of decimal equivalents - kind of a lookup table. For instance every time you needed a 10, using the index of 10 in your decimal array you could then look up the Roman numeral equivalent by that index yielding the X.

Deciding which numbers to include in your lookup table and how to use them still gives you lots to think about.