Salesforce JavaScript Developer Practice Exam 2025 – 400 Free Practice Questions to Pass the Exam

Question: 1 / 400

What are the internal properties of a promise object returned by the new Promise constructor?

state and result

The internal properties of a promise object returned by the new Promise constructor are indeed "state" and "result." In the context of promises in JavaScript, the "state" property reflects the current status of the promise, which can be one of three values: pending, fulfilled (resolved), or rejected. The "result" property holds the value that the promise yields when it is fulfilled or the error if it is rejected.

This understanding of the internal workings of promises is crucial for managing asynchronous operations effectively. It helps developers write code that can appropriately handle scenarios where asynchronous results are not immediately available, and it supports the implementation of logic based on whether a promise has succeeded or failed.

The other options, while related to promises, do not accurately represent the internal properties of a promise. "Status" and "error" are more generic terms that do not reflect the specific properties structured within the promise object. The terms "resolve" and "reject," while important in the context of what a promise does, refer to the functions used to settle a promise rather than properties of the promise itself. Lastly, "pending" and "fulfilled" describe possible states of a promise but do not represent the actual properties used to manage a promise's state and result.

Get further explanation with Examzify DeepDiveBeta

status and error

resolve and reject

pending and fulfilled

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy