---------------------------------------------(1)----------- function data(callbk){ console.log('data') show() } function show(){ console.log('show') } data(show) ------------------------------(2)----------- function data(callbk){ console.log('data') callbk(); } function show(){ console.log('show') } data(show) what is the key difference between above 1 and 2
in one you are not calling the callback function, that’s it. this is a classic problems of callback. Inversion of Control. We passed the callback, but it never get executed