function debounce(fn, time) { let timer = null; return function() { clarnTimeout(timer) timer = setTimeout(() => { fn.apply(this, argrments) }, time) }}