--- id: ae9defd7acaf69703ab432ea title: Smallest Common Multiple isRequired: true challengeType: 5 videoUrl: '' localeTitle: 最小的共同多重 --- ## Description
找到所提供参数的最小公倍数,可以均匀地除以这些参数,以及这些参数之间范围内的所有序号。范围将是两个数字的数组,不一定按数字顺序排列。例如,如果给定1和3,找到1和3的最小公倍数,它们也可以被1到3 之间的所有数字整除。这里的答案是6.记得使用Read-Search-Ask如果你得到卡住。尝试配对程序。编写自己的代码。
## Instructions
## Tests
```yml tests: - text: 'smallestCommons([1, 5])应返回一个数字。' testString: 'assert.deepEqual(typeof smallestCommons([1, 5]), "number", "smallestCommons([1, 5]) should return a number.");' - text: 'smallestCommons([1, 5])应该返回60。' testString: 'assert.deepEqual(smallestCommons([1, 5]), 60, "smallestCommons([1, 5]) should return 60.");' - text: 'smallestCommons([5, 1])应该返回60。' testString: 'assert.deepEqual(smallestCommons([5, 1]), 60, "smallestCommons([5, 1]) should return 60.");' - text: 'smallestCommons([2, 10]) 2,10 smallestCommons([2, 10])应返回2520。' testString: 'assert.deepEqual(smallestCommons([2, 10]), 2520, "smallestCommons([2, 10]) should return 2520.");' - text: 'smallestCommons([1, 13]) 1,13 smallestCommons([1, 13])应返回360360。' testString: 'assert.deepEqual(smallestCommons([1, 13]), 360360, "smallestCommons([1, 13]) should return 360360.");' - text: 'smallestCommons([23, 18]) 23,18 smallestCommons([23, 18])应返回6056820。' testString: 'assert.deepEqual(smallestCommons([23, 18]), 6056820, "smallestCommons([23, 18]) should return 6056820.");' ```
## Challenge Seed
```js function smallestCommons(arr) { return arr; } smallestCommons([1,5]); ```
## Solution
```js // solution required ```