async/await
An async function always returns a promise. await pauses that function’s continuation until its operand settles; rejection behaves like a throw at the await point.
Wait for the value where you need it without blocking the whole thread.
See the mechanism
caller receives a promiseFollow one example
The awaited fulfillment supplies article, then the function returns the title through its own promise. This editor wraps code in an async function, so the shown outer await works here; in a real file, top-level await needs a supported module context. Independent requests need not be awaited one by one: Promise.all can combine them, but handle its rejection behavior deliberately.
Predict, change and check
Predict: Will an async function return a plain title immediately if you omit await at its call site?
Test your explanation: Print typeof articleTitle().then to recognize the promise interface. Then reject the fixture and add try/catch around await to produce a deliberate error result.
The tasks below ask you to explain that result and apply the idea to different inputs.
Apply and distinguish
Await follows an outcome without freezing the host
An async function returns a promise. await pauses that async function's continuation while allowing the host to do other work; it does not block the whole browser like a busy loop. Even an already fulfilled promise resumes through asynchronous continuation semantics.
A try/catch can handle a rejection that is awaited within its protected region. Returning a promise without awaiting it can change which local catch or finally observes the operation. Start independent operations deliberately; several sequential awaits can serialize work that does not actually depend on earlier results.
Check your understanding: State the input contract, identify the operation that changes the result, and give one boundary input that would distinguish the correct rule from the mistake described above.