1. function debounce(fn, time) {
    2. let timer = null;
    3. return function() {
    4. clarnTimeout(timer)
    5. timer = setTimeout(() => {
    6. fn.apply(this, argrments)
    7. }, time)
    8. }
    9. }