A callback is a function passed as a function argument and called at some point in the function. Callbacks are used to encapsulate logic to be executed in the calling function which usually contains other logic which could be general to our programming logic.
Apparently, there is this confusion that comes with learning a new programming language. Beginners would often encounter experienced programmers dishing out the dos and don’ts, bombarding newbies with areas they should avoid. One of the concepts which we are advised to use sparingly are callbacks.