随笔分类 -  js

摘要:函数防抖debounce:(多次操作合并为一次) 1 function debounce (fn,delay) { 2 var timer = null; 3 return function (e) { 4 clearTimeout(timer); 5 timer = setTimeout(() = 阅读全文
posted @ 2022-03-07 16:34 给我一个debug 阅读(26) 评论(0) 推荐(0) 编辑
摘要:宏任务:setTimeout,setInterval,DOM事件,AJAX请求 微任务:Promise,asyc/await 1 //主线程直接执行 2 console.log('1'); 3 //丢到宏事件队列中 4 setTimeout(function() { 5 console.log('2 阅读全文
posted @ 2022-02-20 23:30 给我一个debug 阅读(45) 评论(0) 推荐(0) 编辑
摘要:1.push(),向数组末尾添加一个或多个元素。 2.pop(),删除并返回数组最后一个元素,若数组为空,则返回undefined。 3.shift(),删除并返回数组开头第一个元素,若数组为空,则返回undefined。 4.unshift(),向数组开头添加一个或多个元素。 5.arr1.con 阅读全文
posted @ 2022-02-10 21:46 给我一个debug 阅读(114) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示