Lodash throttle

by riddla

JavaScript

var throttledBark = _.throttle(bark, 100, { trailing: true });
var now = new Date(); 

_.times(3, function(n) {
   setTimeout(function(){ throttledBark(); });
});

function bark() {
    console.log('woof ' + (new Date() - now));
}