Day 29 of learning MERN Stack

์ž‘์„ฑ์ž

์นดํ…Œ๊ณ ๋ฆฌ:

โ† ํ”ผ๋“œ๋กœ
DEV Community ยท Ali Hamza ยท 2026-06-15 ๊ฐœ๋ฐœ(SW)
Cover image for Day 29 of learning MERN Stack

Ali Hamza

Hello Dev Community! ๐Ÿ‘‹

It is officially Day 29 of my journey to master the MERN stack! Tomorrow marks a full month of consistency, and today I wrapped up the absolute final part of Lecture 10 in Apna College’s JavaScript playlist with Shradha Didi. We focused on the modern industry standard for asynchronous execution: Async/Await and IIFE.

Yesterday, we flattened our code using Promise Chaining. Today, I learned the syntax that senior developers use daily to make async operations read like simple, linear code.

๐Ÿง  Key Learnings From JS Lecture 10 (Async/Await)

Async/Await is not a new concept under the hood; it is a beautiful syntax wrapper (syntactic sugar) built on top of native Promises.

1. The async & await Keywords

  • async: Placed before a function declaration, it automatically forces that function to return a Promise.
  • await: Can only be used inside an async function. It pauses the function’s execution line-by-line until the target Promise resolves or rejects.

This completely eliminates the need for chaining .then() blocks! Look how clean this layout is:


javascript
async function getAllData() {
    await getData(1);
    await getData(2);
    await getData(3);
    console.log("All data fetched linearly!");
}

Enter fullscreen mode Exit fullscreen mode

์›๋ฌธ์—์„œ ๊ณ„์† โ†—

์ถ”์ถœ ๋ณธ๋ฌธ ยท ์ถœ์ฒ˜: dev.to ยท https://dev.to/ali_hamza_589ec7b3eb6688d/day-29-of-learning-mern-stack-4g8j

์ฝ”๋ฉ˜ํŠธ

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค