Dynamically bind argument and default value to existing function in Javascript
- by Scott
Let's suppose you have some function someFunc() already defined in javascript, that may or may not have its own argument set defined. Is it possible to write another function to add a required argument and set that argument to a default for someFunc()? Something like:
var someFunc = function(arg1, arg2 ...){ Do stuff...}
var addRequired =…