Javascript – Function that receives a function and a "default parameters" key-value object and returns another function with default arguments set
That sounds kind of complex. The idea here is to write the method "defaultMethod". It receives a function and an object. If the function is a simple add: function add(a,b) { return a+b;}; When calling var add_ = defaultMethod(add,{b:9}); add_(10)…