Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 756 Bytes

File metadata and controls

28 lines (21 loc) · 756 Bytes

Synchronous

Every Statement of code get executed one by one so basically a statement has to wait for earliar statement to get executed.

Example

   console.log("javascript");
   console.log("run");
   console.log("code");

It will print javascript first then run then code .

Asynchronous

It allow to program excuted immediatly without blocking the code unlike the synchronous method. it doesnot wait for earliear statment to get excuted first.

Each task excuted completed independly.

console.log("javascript")
setTimeOut(()=>{
    console.log("run");
    2000
})
console.log("code")

It will print javascript then code then run.