{
  "id": 14708245,
  "title": "Synchronous, Asynchronous, and Promise in Javascript",
  "url": "https://urgent.news/2026/10/15/synchronous-asynchronous-and-promise-in-javascript",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-15T13:50:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sajin_joe/synchronous-asynchronous-and-promise-in-javascript-5e7l"
  },
  "original_language": "en",
  "account": "Synchronous JavaScript operates line by line, executing each instruction in order. The subsequent line waits until the current one concludes. For instance, console.log(\"First\"); console.log(\"Second\"); console.log(\"Third\"); produces First Second Third. Each statement runs sequentially, with no overlap.\n\nAsynchronous JavaScript permits operations to commence and conclude at varied intervals, enabling other code to execute concurrently. console.log(\"First\"); setTimeout(function() { console.log(\"Second\"); }, 2000); console.log(\"Third\"); outputs First Third Second. \"First\" prints instantaneously. \"setTimeout()\" schedules the callback to execute after a minimum of 2 seconds. \"Third\" prints without waiting for the timer. \"Second\" prints once the timer callback runs.\n\nA Promise embodies the eventual outcome of an asynchronous operation – success or failure. It exists in three states: Pending (operation incomplete), Fulfilled (success), or Rejected (failure). let myPromise = new Promise((resolve, reject) => { resolve(\"Task completed!\"); }); myPromise.then(result => { console.log(result); }); Outputs Task completed!. Here's a rejected Promise: let myPromise = new Promise((resolve, reject) => { reject(\"Something went wrong\"); }); myPromise.catch(error => { console.log(error); }); Outputs Something went wrong.",
  "summary": "1. Synchronous JavaScript Synchronous means code executes one line at a time, in order. The next line waits until the current line finishes. Example: console . log ( \" First \" ); console . log ( \" Second \" ); console . log ( \" Third \" ); Output : First Second Third Explanation: First line executes. Then the second line executes. Finally, the third line executes. Each statement runs in sequence.…",
  "key_points": [
    "Synchronous JavaScript executes code line by line, sequentially.",
    "Asynchronous JavaScript allows concurrent execution of operations.",
    "Promise represents outcome of asynchronous operation, in Pending, Fulfilled, or Rejected state."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}