Functions can be stored in variables, passed as arguments to functions, created within functions and returned from functions. Because functions are first class objects, we can pass a function as an argument in another function and later execute that passed-in function. $('#btn_1').click(function () { alert('HUEHUE BRBR'); }); var showAlert = function () { alert('HUEHUE BRBR'); }; $('#btn_1').click(showAlert); @di3goleite
or more then() method calls that // don't provide an error handler. Then the error is // passed on until there is an error handler asyncFunction1() .then(asyncFunction2) .then(asyncFunction3) .catch(function (error) { // Something went wrong above }); Promises can be chained. This is one of the fundamental point to understand it. @di3goleite