SOURCE

function debounce(fn, delay) {
    let timer;
    return function () {
        let context = this;
        let args = arguments;
        clearTimeout(timer);
        timer = setTimeout(function() {
            fn.call(context, args);
        }, delay)
    }
}
console 命令行工具 X clear

                    
>
console