To start off you are passing most of the test, but as long as that console.log exist at the bottom of the code they will all fail as your arr_num is global so when you call your convertToRoman function it populates the array causing you to fail all the test, and my recommendation is to not use a global array, but you can simply just git rid of the log and it will most test will pass.
Once you have fixed the console.log problem you will still be failing three test and the reason for this is due to the fact that num can be given to function that will subtract more from it than num has value such as:
else if (num >= 40) {
num = fiftyBreak(num);
I would generally say this is bad code, but as luck would have it this problem only ever occurs with the fiftyBreak function allowing for a lazy patch to be made, and wether you want to rethink your entire logic or go with the lazy patch is up to you .
The patch works such that if num becomes negative due to the function then you make num equal to the number that would be in its tens place so if num equaled 44 then the function would make num equal to 4 rather than -6. It is important that you only do this as the last thing before returning from the function or simply use a ternary in the return.
An important aspect of your code is how it looks. The harder it is to read you code the less other people are going to want to deal with it so I’ll will start off with some stylistic changes that could be made.
With some exceptions the naming convention in JS is lower camelCase so arr_num should be arrNum.
Indentions and a good amount of white space between things are probably the best thing you can do to make your code more readable. Any time you enter a new inner scope in your code you need to indent inwards and anytime you back out to a outer scope you need to go back to the right indention level:
//global scope no indentions
function func () {
//this scope is closed from the global so you should indent
let a = 1;
//I put whitespace here to make it more readable
if (a) {
//an (if) is another layer of scope so you should indent
let b = 2;
//func can't use b as it doesn’t have access to this inner scope
}
}
On the more logical side of things I would say your code is very imperative and this sort of problem certainly leans into a more imperative solution, but if you are to imperative and try to cover every case manually the first moment you function is given a case you didn’t write for it will fail. Generalize where you can and you will save yourself a ton of time and you’ll also have written better code.