Smallest Common Multiple Code

Tell us what’s happening:

Your code so far

function smallestCommons(arr) {
  var arr1 = [];
  var arr2 = [];
  var count = arr[0];
  for(var i=1; i<100;i++) {
    arr1.push(i*arr[0]);
    arr2.push(i*arr[1]);
  }
  for(var s=0; s<arr1.length;s++) {
    for(var t=arr[0]; t<=arr[1];t++) {
      if(arr1[s] % t ==0) {
        count++;
        console.log(count);
      }
    }
    if(count>=arr[1]) {
      return arr[s];
    } else {
      count=arr[0];
    }
    
  }
  return count;
}


smallestCommons([1,5]);
console.log("end");```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/smallest-common-multiple

Do you have a question?

I can’t get the code to work and I was wandering where I went wrong

It’s returning undefined. Although it should return a number