Roman Numerals in Javascript

I was looking at some code that included converting arabic to roman numerals, and it was all things like this: