{
  "id": 528054,
  "title": "Data Scientist Learning JS: Promises and resolve()",
  "url": "https://urgent.news/2026/08/11/data-scientist-learning-js-promises-and-resolve",
  "topic": "science",
  "section": "Science",
  "published": "2026-08-11T03:44:43.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/j1wonkim/data-scientist-learning-js-promises-and-resolve-p9l"
  },
  "original_language": "en",
  "account": "A data scientist transitioning to development from Python and R shares their experience learning JavaScript, specifically focusing on Promises and the resolve() method. To illustrate the concept, they created a mock data layer for a fitness social app, simulating network requests for fetching new posts.\n\nThe function fakeFetchPosts() returns a Promise that resolves with an array of mock posts after a 2-second delay. The main() function logs \"Fetching...\", then awaits the resolution of fakeFetchPosts() using the await keyword. The fetchedPosts are then logged, followed by \"Sync code ran\".\n\nThe author initially confused the logic with blocking, comparing it to Python's time.sleep() or Selenium's WebDriverWait(). In JavaScript, however, the single-threaded program continues executing other code during the wait, which is why the output shows \"Fetching...\", \"Sync code ran\", and finally \"Fetched posts:\" with the array of posts.",
  "summary": "Context: I'm a data scientist/analyst (in Python and R) learning development from scratch. Inevitably, I am learning these through the lens of what I already know. If you have a similar background and are a beginner developer, I hope these analogies help! Any comments, especially if you spot any misunderstanding, are appreciated. Commenting is caring <3 Motivation: I was building a mock data…",
  "key_points": [
    "Data scientist learns JavaScript, focusing on Promises and resolve()",
    "FakeFetchPosts() function returns Promise resolving with mock posts after 2 seconds",
    "await keyword allows JavaScript single-threaded program to continue executing during wait"
  ],
  "editors_take": "The author's experience with JavaScript Promises reveals a fundamental shift from blocking code in Python and R to non-blocking execution in JavaScript, where other code runs during waits.",
  "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."
}