此方法性能虽然不如递归,但是也是一种解法。 function _factorial(number) { // 补全代码 let range = { from: 1, to: number } range[Symbol.iterator] = function () { return { current: this.from, last: this.to, next() { if (this.current <= this.last) { return { done: false, value: this.current++ } } else { return { done: true} ...