Friday, December 13, 2019

Asynchronous vs Synchronous in NodeJS

Firstly you need to know that node js uses v8 engine which is used in google chrome but its changed a bit it simply translates the js code to c++ gets the result and then send it back, one more point it's a forever looping function.

in an Asynchronous it loops the first time and puts them in the event listener and when its time for it to be invoked it goes to the queue and then it gets invoked and if we have multiple functions the work at the same time.

Synchronous is the oppisite of  Asynchronous it goes line by line and excutes the function waits for the result and then moves on to the next function
.

No comments:

Post a Comment