Ok, this is a very simple question. I am actually 90% sure I know the answer, but the late hour is causing me to completely space it. I've searched it on SO and Google to no success.
How do I get return data from an event handler function?
I have several nests of event handlers, and need to get the result from the deepest out to the main output.
Like so (pseudocode):
mainFunction = function() {
attachToEvent( 'event1', function( e1 ) {
e.attachToEvent( 'event2', function( e2 ) {
return e2.status;
}
}
}
console.log( mainFunction() );
What is the proper pattern to get that return data(e2.status
) out to the console?
Again, I apologize for the simplicity of this question.
Thanks