nerdexam
CIW

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…

Client-Side Scripting and Media Queries

Question

Which feature allows JavaScript functions to be called asynchronously?

Options

  • Atry...catch
  • Bfor...in
  • Casync/await
  • Dthis

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    94% (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

#async/await#asynchronous programming#JavaScript functions#promises

Community Discussion

No community discussion yet for this question.

Full 1D0-720 Practice