Issue with Callback
14th November 2022
Basically There are two main disadvantages with callback are
- Callback hell :It happens when we are using callback into the hierarchy like passing callback into one function,
and that function is also return another callback and it goes on,then
by this method our code is not easy to understandable and maintainable ,
it make our code very hard to manage.
-
Inversion Of Control : It happens When the Control of Program is goes out of our hands.
In API's due to nested callback function,
we gave control of execution of inside callback function to some other function and we don't know whether that function will ever execute our function properly or not
So to avoid this callback issue , we use promise method.