Convert Integer to Roman Numeral
First, you can easily throw away semicolons ";".

Second, if you want shorter code, you can do like this:

function arabicToRoman(num) {
  var roman = {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}
  var result = ''

  for (var i in roman) {
    while (num &gt;= roman[i]) {
      result += i
      num -= roman[i]
    }
  }
  return result
}


But, it's also almost ten times slower, so it's up to you - do you need compact code, or performance?