How does the definition of throttling look like anti-shake in javascript advanced programming?

does it feel that the definition of throttling in js elevation is different from that in blogs? I feel that this definition is like anti-shaking, which is similar to the debounce method in underscore, and I prefer to think that this idea is called anti-shaking. Please correct the boss
.
this is the definition and code for throttling in elevation


//
function debounce(fn, delay){
    let timer = null;
    return function() {
        let context = this;
        let args = arguments;
        clearTimeout(timer);
        timer = setTimeout(function(){
            fn.apply(context, args);
        }, delay)
    }
}
Apr.29,2021

throttling: change multiple execution to perform
Anti-shake at regular intervals: turn multiple execution into the last execution
No problem. Why don't you take a good look at it?


both throttling and anti-shaking belong to throttling.
or, throttle and debounce are two similar but slightly different implementations of throttling techniques.

Menu