js函数防抖和函数节流

函数防抖(debounce): input框点击搜索按钮只在最后一次进行搜索web function debounce () { let timer = null return function () { clearTimeout(timer) timer = setTimeout(() => { console.log('开始搜索') },500) } }
相关文章
相关标签/搜索