Debounce function with args underscore
javascript, underscore.js
Solution
You should be able to just use an anonymous function as the first argument, then call whatever you like in it:
_.debounce(function(){
calculateLayout(20, 30);
}, 300);
Problem
I've got a function which takes in some arguments. But usage of underscore debounce is : ``` var lazyLayout = _.debounce(calculateLayout, 300); ``` But in my case `calculateLayout` needs some arguments to run. How can I pass them in this case? Update : Sample `calculateLayout` function : ``` var calculateLayout = function(a,b) { console.log('a is ' + a + ' and b is ' + b); } ```