It's one of those times where I want to do soemthing, but I'm not sure what it's called...
Hopefully, someone can help!
I have the following function:
function myfunction(object1, object2) { ... }
I want to pass another function onto object1 specifically using the .click method.
I can get this working easily with only one object within the function using the following:
function myFunction(object1) { ... }
$('button').click(function() {
// Passes along another function!
myFunction(anotherFunction());
});
How would someone approach this when there are 2 objects? I can't seem to get anything working. Any ideas? Or am I approaching this the wrong way?
()
off of theanotherFunction
when you pass it.aThirdFunction()
as the value of the parameterobject2
, the same way you did withanotherFunction()
forobject1
:myFunction(anotherFunction(), aThirdFunction())
. If you want something different, could you explain it differently than "pass a function onto an object"?