2018年12月10日

防抖与节流原理与区别

摘要: // 防抖就是事件 :多次触发事件后, //事件处理函数只执行一次, //并且是在触发操作结束时执行 //事件多次触发清除之前的定时器 let timer; window.onscroll = function() { console.log(12) if (timer) { clearTimeou 阅读全文

posted @ 2018-12-10 17:59 田庚的博客园 阅读(1920) 评论(0) 推荐(0)

js 原型链,继承,闭包,内存,泄露

摘要: var A = function(){ this.name="xiaoming"; } A.prototype.age=9; var a = new A(); console.log(a.age); //9 图中长方形代表实例对象a,圆形代表原型,三角形代表构造函数。由图可知: a.__proto__ === A.prototype; //true A.prototype.construct... 阅读全文

posted @ 2018-12-10 14:26 田庚的博客园 阅读(342) 评论(0) 推荐(0)

导航