--- title: Factors of an integer id: 597f1e7fbc206f0e9ba95dc4 challengeType: 5 videoUrl: '' localeTitle: 整数因子 --- ## Description

编写一个返回正整数因子的函数。

这些因子是正整数,通过该正整数可以将被分解的数量除以产生正整数结果。

///
## Instructions
## Tests
```yml tests: - text: factors是一种功能。 testString: 'assert(typeof factors === "function", "factors is a function.");' - text: 'factors(45)应该返回[1,3,5,9,15,45] 。' testString: 'assert.deepEqual(factors(45), ans[0], "factors(45) should return [1,3,5,9,15,45].");' - text: 'factors(53)应该返回[1,53] 。' testString: 'assert.deepEqual(factors(53), ans[1], "factors(53) should return [1,53].");' - text: 'factors(64)应该返回[1,2,4,8,16,32,64] 。' testString: 'assert.deepEqual(factors(64), ans[2], "factors(64) should return [1,2,4,8,16,32,64].");' ```
## Challenge Seed
```js function factors (num) { // Good luck! } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```