What is `Promise.resolve(42)` equivalent to?

JavaScript Developer Easy

JavaScript Developer — Easy

What is `Promise.resolve(42)` equivalent to?

Key points

  • `Promise.resolve()` creates a Promise that is already resolved.
  • The correct answer involves resolving the Promise with the value 42.
  • Other options involve rejecting the Promise, creating a Promise with an array, or using an async function.
  • Understanding how to create and handle Promises is crucial for JavaScript developers.

Ready to go further?

Related questions