SOURCE

console 命令行工具 X clear

                    
>
console
function debounce(func, wait) {
    var timeout;

    return function () {
        var context = this;
        var args = arguments;

        if (timeout) clearTimeout(timeout);
        
        timeout = setTimeout(function(){
            func.apply(context, args)
        }, wait);
    }
}



function xxx(){
  debounce(function(){
      console.log(1)
    },1100)
}
<input type="text" oninput="xxx()"/>