I am new to javascript and I need to chain functions execution, but function to react on success and failure different. Array of functions is get as parameter and result from previous is input parameter for next in chain in case of success, in error case I can define some alert/log behavior. I like how jquery has for exampel for GET ajax method success and failure. How to make that inner function fire those events, how is this implemented in javascript ?I am new to javascript and I need to chain func