I have two functions function1
and function2
. I want to call the function2
after the function1
is complete and want to use function1
's return value as function2
's parameter
when I call these functions, the function2
is executing first
var a = function1();
function2(a);
I checked this answer:
Call a function after previous function is complete
but I want to return a value from function1
and use it in function2
. How can I do that?