Skip to content

Improve Async/Await lecture comment about where await is used #66932

@hbar1st

Description

@hbar1st

Describe the Issue

In the lecture on Async/Await called "What Is Async/Await, and How Does It Work?", the following somewhat awkward and somewhat incomplete statement is made:

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.

I am proposing that this should be corrected to:

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.

This change would make it so the sentence mentions that await can be used in the body of a module, which was missing in the prior statement. (discussed with @naomi-lgbt who has approved the proposed change)

The file that would need to change is:
freeCodeCamp/curriculum/challenges/english/blocks/lecture-understanding-asynchronous-programming/673407d56c3dce67fa97969b.md

Affected Page

https://www.freecodecamp.org/learn/javascript-v9/lecture-understanding-asynchronous-programming/what-is-async-await-and-how-does-it-work

Metadata

Metadata

Assignees

No one assigned

    Labels

    js v9 certThis is for the JS V9 certification.scope: curriculumLessons, Challenges, Projects and other Curricular Content in curriculum directory.status: PR in worksWork in Progress (WIP) Issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions