I have been working on async programming in JavaScript recently. I've been coming through many code snippets and also in jQuery methods, where if we pass a callback function as a parameter to another function, it executes asynchronously. The call back is executed after the execution of that function completes.
I have been through some answers on Stack Exchange network on this topic. One guy said we cannot make our code asynchronous unless we depend on a native method for that functionality
see here https://stackoverflow.com/a/9516967
alse here https://softwareengineering.stackexchange.com/a/194591
Another guy said that just passing callbacks to events makes our code asynchronous. https://softwareengineering.stackexchange.com/a/194581
My question is that what makes code asynchronous, by just passing a callback, or should we depend on native methods like setTimeout or setInterval to attain async functionality?