Difference between Synchronous and Asynchronous?

Synchronous means to be in sequence. Every statement of the code gets executed one by one. Statement has to wait for earlier statement to get executed. The fs(file system) module from node.js has synchronous methods to execute code synchronously.

Asynchronous code allows the program to be executed immediately. This may not look like a big problem bt when you see it in a bigger picture, you realize that it may lead to delaying the user interface. Asynchronous programming in JavaScript can be done using callbacks, promise, and async-await. You can also use asynchronous methods of nodejs modules.