Ego

Results 5 comments of Ego

> @wjryours sum 函数定义的参数长度为 3,调用时参数为 4,所以问题出在这里 柯里化生成的 add 函数若是存储的形参个数达不到定义的参数长度, 则是返回 [Function] 那么如题 add(1) ==>1 , add(1)(2) ==> 3 则不是没有实现吗

区间分类 ``` // 得到一个两数之间的随机整数,包括两个数在内 function getRandomIntInclusive(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值,含最小值 } // 随机生成10个整数数组, 排序, 去重...

连续元素分类 ``` // 得到一个两数之间的随机整数,包括两个数在内 function getRandomIntInclusive(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值,含最小值 } // 随机生成10个整数数组, 排序, 去重...

``` function print(n){ setTimeout(() => { console.log(n); }, 1, Math.floor(Math.random() * 1000)); } for(var i = 0; i < 100; i++){ print(i); } ```