js函數防抖和函數節流

函數防抖(debounce): input框點擊搜索按鈕只在最後一次進行搜索web function debounce () { let timer = null return function () { clearTimeout(timer) timer = setTimeout(() => { console.log('開始搜索') },500) } }
相關文章
相關標籤/搜索