I have a situation like this:
"render": function(a, b) { // do stuff }
I want to change this to a named function:
"render": foo
function foo(a, b) { // do stuff }
The thing is, the function can do different things in different situations, so I want to add another parameter like this:
function foo(a, b, type)
How do I call this function and still pass in the original parameters? I have no control over the code that calls this method so I don't know where a
and b
come from.