摘要: 防抖函数:将多次触发变成最后一次触发 function debounce(fn,wait){ let timer = null; return function (){ let arg = arguments; if(timer){ clearTimeout(timer); timer = null 阅读全文
posted @ 2021-06-25 15:16 Fairy-Tail 阅读(29) 评论(0) 推荐(0) 编辑
摘要: this也是代名词,它的场景就是函数。this是函数里的内置对象。 一、this的四种情况:1)、当this所在函数是事件处理函数时。this表示事件源 2)、当this所在函数是构造函数时,this是new出来的对象 3)、当this所在函数是类的方法时,this是调用方法时的对象(写在方法调用前 阅读全文
posted @ 2021-06-25 11:14 Fairy-Tail 阅读(85) 评论(0) 推荐(0) 编辑