I can’t figure out what’s wrong with my code. It passes ALL tests except for the final one which requires me to find the smallest common multiple of 23 and 18 given the requirements. Here is my code. Yes, it’s definitely not the best code, I was planning to clean it up later once I got the basic requirements down.

```
<code>
function smallestCommons(arr) {
//sorts parameters
var smaller;
var bigger;
if (arr[0] < arr[1]) {
smaller = arr[0];
bigger = arr[1];
}
else {
smaller = arr[1];
bigger = arr[0];
}
//creates array for smallest common multiples of both parameters
var multiples_bigger = [];
var multiples_smaller = [];
//finds smallest common multiple that meets requirements for each parameter
for (var j = 1; j < 10000000; j++) {
if ((bigger * j) % 2 == 0 && (smaller * j) % 2 == 0) {
for (var q = smaller; q < bigger; q++) {
if ((bigger * j) % q != 0 && (smaller * j) % q != 0) {
break;
}
else if (q == bigger - 1) {
multiples_bigger.push(bigger * j);
multiples_smaller.push(smaller * j);
}
}
}
}
//placeholder number that will be used to test value of numbers in array
var smaller_number = 10000000;
//finds the smallest common multiple in the big array
for (var z = 0; z < multiples_bigger.length; z++) {
if (multiples_bigger[z] <= smaller_number) {
smaller_number = multiples_bigger[z];
}
}
//matches smallest common multiple in big array with element in small array
var lcm = multiples_smaller.indexOf(smaller_number);
return multiples_smaller[lcm];
}
smallestCommons([23, 18]);
</code>
```