1D0-720 · Question #18
Which feature allows JavaScript functions to be called asynchronously?
The correct answer is C. async/await. async/await is JavaScript's syntax for writing asynchronous code that reads like synchronous code - marking a function with async makes it return a Promise, and await pauses execution inside it until a Promise resolves, without blocking the main thread. try...catch (A) is…
Question
Which feature allows JavaScript functions to be called asynchronously?
Options
- Atry...catch
- Bfor...in
- Casync/await
- Dthis
How the community answered
(50 responses)- A4% (2)
- B2% (1)
- C94% (47)
Explanation
async/await is JavaScript's syntax for writing asynchronous code that reads like synchronous code - marking a function with async makes it return a Promise, and await pauses execution inside it until a Promise resolves, without blocking the main thread.
- try...catch (A) is error-handling syntax - it catches exceptions but has nothing to do with asynchronous execution.
- for...in (B) is a loop construct for iterating over object keys - entirely unrelated to async behavior.
- this (D) is a context keyword referring to the current object - it controls scope, not execution timing.
Memory tip: Think of async/await as "wait for it" - the await keyword literally makes the function wait for an async operation to finish before moving on, which is the core idea of asynchronous programming made readable.
Topics
Community Discussion
No community discussion yet for this question.