var noThrottledCount = 0; var throttledCount = 0; var noThrottledElem = document.getElementById('no-throttle'); var throttledElem = document.getElementById('throttle'); var noThrottledFunc = function() { noThrottledElem.innerHTML = noThrottledCount++; }; var throttledFunc = _.throttle(function() { throttledElem.innerHTML = throttledCount++; }, 100); document.documentElement.onmousemove = function() { noThrottledFunc(); throttledFunc(); };