Tuesday 25 June 2019

This is what I have understand about single-thread and synchronous. Do i'm right?

JavaScript is Single Threaded and has Synchronous execution model. Single thread means execution commands run on a single thread and executes one at a time, I imagine as ants marching. i.econsole.log('print1'); console.log('print2'); console.log('print3'); // Output print1 - runs first print2 - runs second and so on. Synchronous means execution command executes (runs) and wait until execution finishes/returns and move to next command. i.efetchUser(); fetchPosts(); // fetchUser() executes and waits until user list return and moves to fetchPosts(); If I have understand it wrong, please comment below

Submitted June 25, 2019 at 03:13PM by Chawki_

No comments:

Post a Comment