Issue with codewars js task

This is my code task:

In this simple exercise, you will build a program that takes a value, integer , and returns a list of its multiples up to another value, limit . If limit is a multiple of integer, it should be included as well. There will only ever be positive integers passed into the function, not consisting of 0. The limit will always be higher than the base.

For example, if the parameters passed are (2, 6), the function should return [2, 4, 6] as 2, 4, and 6 are the multiples of 2 up to 6.

const arr=[];

function findMultiples(integer, limit) {
  //your code here
  if (integer < limit && integer > 0){
    if(limit % integer === 0){
    let tempResult = limit / integer;
    for (let i=1; i < tempResult + 1; i++){
     arr.push(i * integer);
    }
    }else if (limit % integer !== 0){
    let calcRemainder = limit % integer;
    let result = (limit - calcRemainder) / integer;
    for (let i=1; i < result + 1; i++){
     arr.push(i * integer);
    }
    }
    console.log(arr)
    }else {
      console.log('invalid input')
      return ''
    }
  
}
findMultiples(4, 19)

And this is the test result:

Test Results:
Log
[ 4, 8, 12, 16 ]
Tests
Basic Tests
Log
[
4, 8, 12, 16, 5,
10, 15, 20, 25
]
expected undefined to be an array
Completed in 3ms
Random Tests
Log
[
4, 8, 12, 16, 5, 10, 15,
20, 25, 1, 2, 3, 4, 5,
6, 7, 8
]
Testing for integer=1 and limit=8: expected undefined to be an array.

I don’t understand why codewars don’t accept my code. The strange thing for me is when codewars tests my code it returns always an array with the elements 5,10,15,20,25. What am i doing wrong ?

Thanks in advance