Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with "Introducing asynchronous JavaScript": (text says the why we can't use an object that is returned async directly in main thread is maybe it is not completely done) #10051

Closed
usfstdd opened this issue Oct 24, 2021 · 1 comment
Labels
Content:Learn:JavaScript Learning area JavaScript docs

Comments

@usfstdd
Copy link

usfstdd commented Oct 24, 2021

MDN URL: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Introducing

What information was incorrect, unhelpful, or incomplete?

in the example that suggest access to image.src and see how asyc operations work. the text says the reason why we get this error (TypeError: image is undefined; can't access its "src" property) is "You just can't guarantee that the async function will return before the browser has processed the sync block."
but the thing that i learn according other mdn documents is all async callbacks will added to event queue and will execute after pop off of last stack that is related to main thread.the good example of that is calling setTimeout with zero delay.

MDN Content page report details
@Rumyra Rumyra added Content:JS JavaScript docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Nov 1, 2021
@sideshowbarker sideshowbarker added Content:Learn:JavaScript Learning area JavaScript docs and removed Content:JS JavaScript docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Apr 2, 2022
@Josh-Cena
Copy link
Member

This has been fixed via #12930

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:Learn:JavaScript Learning area JavaScript docs
Projects
None yet
Development

No branches or pull requests

5 participants