AngularJS Promises

AngularJS Promises


Answer AngularJS Promises questions below and test your knowledge about AngularJS Promises.

1. A promise implementation in one of its simplest forms is as follows:

A) var promise = new Promise( () => ());
B) var promise = new Promise( () -> {});
C) var promise = new Promise( () => []);
D) var promise = new Promise( () => {});

2. A promise represents the final result of an . . . . . . . operation.

A) asynchronous
B) synchronous

3. A promise may be in one of the following states:(choose all that apply)

A) Pending state
B) Resolved state
C) Rejected state
D) Controlled state

4. The . . . . . method is a shorthand for promise.then(null, errorCallback).

A) errorCallback()
B) Call()
C) catch()
D) reject()

5. Promises require the caller to have access to the original function that returned the Promise in order to have a retry capability.

A) True
B) False

6. The promise constructor doesn't care at all about how the executor function behaves. It merely provides it with the two . . . . . and . . . . . functions.

A) retry
B) resolve
C) reject
D) catch

7. The return value of executor is unimportant. No Matter what it returns, the promise constructor will always return the oldest created promise.

A) True
B) False

8. The promise handler definition method then() returns another promise, which can have further handlers defined upon it - in a handler called . . . . .

A) tree
B) chain
C) recur
D) root

9. Once a Promise's state becomes fulfilled or rejected, attempts to reject or resolve that promise further will be silently ignored.

A) True
B) False

10. The promise becomes . . . . . . after resolving or rejecting.

A) mutable
B) ignored
C) immutable
D) recurring

Answers