![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
yttcat
这个作者很懒,什么都没留下…
展开
-
promise generator
demo原创 2021-08-12 20:56:30 · 101 阅读 · 0 评论 -
宏任务和微任务
结论: 微任务执行时序比宏任务早 微任务>dom渲染>宏任务 宏任务: 定时器,dom事件 网络请求 微任务:promise async/await 宏任务,微任务 都是异步任务,异步任务的本质就是回调函数 ...原创 2021-08-12 08:34:49 · 96 阅读 · 0 评论 -
js 前端 银行卡图标处理
https://daimajiaoliu.com/daima/60b359e06be6c08转载 2021-08-11 11:25:45 · 468 阅读 · 0 评论 -
js apply call bind
// bind:返回一个新的函数 this指向 bind 后面跟的对象 const a = { x: 100, getx: function () { console.log(this.x); return this.x; }, }; const b = a.getx; // console.log(b()); const c = b.bind(a); console.log("c:", c()); const x = [1, 2, 3]; const y = ["a",..原创 2021-08-11 07:34:30 · 60 阅读 · 0 评论 -
js once
function once(fn) { let done = false; return function (...args) { if (!done) { done = true; fn.call({}, ...args); } }; } const pay = once(function (money) { console.log("支付" + money + "元"); }); pay(5); pay(5); pay(5); pay(5);.原创 2021-08-11 00:27:13 · 283 阅读 · 0 评论 -
js模拟柯里化函数
function getSum(a, b, c) { console.log(a + b + c); return a + b + c; } function curry(func) { return function curriedFn(...args) { if (args.length < func.length) { return function () { return curriedFn(...args.concat(Array.from(.原创 2021-08-11 00:12:24 · 61 阅读 · 0 评论 -
javascript 当中的函数库
lodash 函数在后,数据在前;(lodash/fp) fp 模块是纯函数 柯里话化函数在前,数据在后 ramda ...函数在前,数据在后 folktale compose curry原创 2021-08-10 21:25:13 · 77 阅读 · 0 评论 -
js 高频操作下的防抖节流
function myDebounce(handle, wait, immediate) { // 参数类型判断及默认值处理 if (typeof handle !== 'function') throw new Error('handle must be an function') if (typeof wait === 'undefined') wait = 300 if (typeof wait === 'boolean') { im.原创 2021-08-10 21:19:47 · 167 阅读 · 0 评论