Hi

I’m trying to use the array.forEach() function in order to test whether all the numbers in the array are divisible by multiples of the largest number in the array.

Eg. arr = [4, 3, 2]

Check if multiples of 4 (4, 8, 12) are divisible by 3 and 2.

My code so far is this. I don’t know what to put in the while() condition though. Any ideas?

```
function smallestCommons(arr) {
//convert arguments into array
arr = Array.prototype.slice.call(arguments);
arr = arr[0];
//sort the array from highest to lowest number
function compareNumbers(a, b){
return b-a;
}
arr.sort(compareNumbers);
console.log(arr); //this is the lowest number in the original array
//fill the array with numbers between the lowest and highest numbers. first check how many numbers there will be in the whole array.
var inArr = arr[0]-arr[1]+1;
console.log("number of elements in new array: " + inArr);//this is the number of elements in the array (original elements + new elements)
var x;
for (x = 1; x < inArr; x++){
arr[x] = arr[x-1] - 1;
}
console.log("new array: " + arr); //the new array containing original elements + new elements
var mult = 1;
var common = 0;
function isDivisible(el){
common % el === 0;
}
do{
common = arr[0]*mult;
if (arr.every(isDivisible)){
return common;
}
mult++;
} while(???);
```