![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js编程
Markson_1
这个作者很懒,什么都没留下…
展开
-
JS编程实现-throttle(节流)
// 对fn进行节流处理let throttle = function (fn, wait) { let firstTime = true, timer = null return function () { let _this = this if (firstTime) { fn.apply(_this, ...原创 2020-01-12 09:55:04 · 304 阅读 · 0 评论 -
JS编程实现-currying(柯里化)
// 参数先给你存着,等你没参数了再一起给你let currying = function (fn) { let argArr = [] return function () { if ( arguments.length === 0) { // 卡了很久是因为不熟悉apply的参数列表跟fn的关系 // 虽然arg...原创 2020-01-12 09:46:55 · 148 阅读 · 0 评论