Need helping keyboard ;)

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function smallestCommons(arr) {
let max = Math.max(arr[0], arr[1]);
let min = Math.min(arr[0], arr[1]);
let myArrMul = [];
let upperBound = 1;
let myArr = []

for(let i = min; i <= max; i++){
  upperBound *= i;
  myArr.push(i)
}

for(let j = 1; j <= upperBound; j++){
  if(j % max == 0){
    myArrMul.push(j);
  }
}
let finalArr = myArrMul.filter( item =>{
   return item % myArr[0] == 0 && item % myArr[1] == 0 && item % myArr[2] == 0 && item % myArr[3] == 0 && item % myArr[4] == 0;
});
return finalArr[0];
}


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

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36

Challenge: Smallest Common Multiple

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.