JavaScript Decimal To Roman

Hi guys, I am stuck on this project. My mind is clouded and frustrated because I don’t see enough at this level. Do you have any tips apart from those in the project that can help me?

function convertToRoman(num) {

var arr = [1,4,5,9,10,40,50,90,100,400,500,900,1000]

var arr1 = ["I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M"]

var result="";

var n;

var letter;

   for(var i=12;n=arr[i],letter=arr1[i];i--){




  return num;