fix(curriculum): clarify async/await explanation in lecture content (#66935)

This commit is contained in:
Ayush Kumar Singh
2026-04-14 22:30:21 +05:30
committed by GitHub
parent 526e09bbf0
commit dabb661d06

View File

@@ -9,7 +9,7 @@ dashedName: what-is-async-await-and-how-does-it-work
In the previous lessons, you learned about asynchronous programming which allows other code to run while we wait for some time-consuming tasks to complete, like fetching data from a server, reading data from a file, and so on.
`async`/`await`, built on top of promises, makes writing and reading asynchronous code easier. When you put the `async` keyword before a function, it means that function will always return a `Promise`. Only inside an `async` function, you can use the `await` keyword, which allows you to wait for a `Promise` to resolve before moving on to the next line of code. Here's an example to illustrate how `async`/`await` works:
`async`/`await`, built on top of promises, makes writing and reading asynchronous code easier. When you put the `async` keyword before a function, it means that function will always return a `Promise`. The `await` keyword, which allows you to wait for a `Promise` to resolve before moving on to the next line of code, can only be used inside of asynchronous functions or the top level bodies of modules. Here's an example to illustrate how `async`/`await` works:
:::interactive_editor