Synchronous code is code that executes one instruction at a time, in a specific order.
JavaScript executes synchronous code line by line. The next instruction generally waits until the current instruction has finished executing.
console.log("First");
console.log("Second");
console.log("Third");
Output:
First
Second
Third
console.log().console.log().console.log().Each instruction waits for the previous one to complete.
console.log("Start");
let result = 10 + 20;
console.log(result);
console.log("End");
Output:
Start
30
End