how does this window resize function work?
<p>A while back i asked for a javascript function that would allow me to resize content within a browser window at a set interval. Like, not with every pixel-sized change. I was given this function:</p>

<pre><code>function throttle (func, wait) {
    var throttling = false;
    return function(){
        if ( !throttling ){
            func.apply(this, arguments);
            throttling = true;
            setTimeout(function(){
                throttling = false;
            }, wait);            
        }
    };
}


window.onresize = throttle(function() {
    resize_columns();
}, 20);
</code></pre>

<p>The person said that at that time s/he did not really have time to explain closures. I still don't understand how it works. Can someone explain it to me?</p>

<p>Thank you.</p>
