function to find the smallest common multiple between two numbers
function smallestCommons(arr) { var max = Math.max(arr[0], arr[1]); var min = Math.min(arr[0], arr[1]); var multiple = max; for (var i = max - 1; i >= min; i--) { if (multiple % i) { multiple += max; i = max; } } return multiple; }