Interested in programming since an early age; decades as a hobbiest; years as a teacher and tutor. These days working a lot with JavaScript and Python, but I try to explore everything.
A function marked as async will happen concurrently with other code. So for example, here's some very slightly altered code from the MDN documentation:
The MDN documentation explains that only async functions are allowed to use the "await" keyword. This causes the function's execution to pause and wait for some Promise to be fulfilled. This isn't allowed in normal functions because it would 'lock up' the execution of javascript code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Mozilla has very good documentation. I always consult it.
developer.mozilla.org/en-US/docs/W...
A function marked as async will happen concurrently with other code. So for example, here's some very slightly altered code from the MDN documentation:
If you run that, what you'll see output is:
and a couple seconds later
The MDN documentation explains that only async functions are allowed to use the "await" keyword. This causes the function's execution to pause and wait for some Promise to be fulfilled. This isn't allowed in normal functions because it would 'lock up' the execution of javascript code.