JavaScript objects that represent the eventual result of an asynchronous operation.
Promises
A function that is passed as an argument to another function.
A callback function
The keyword that indicates an asynchronous function?
async
What API stands for.
Application Programming Interface
What the data-transfer format JSON stands for.
JavaScript Object Notation
The two possible outcomes of a promise that has been settled.
resolved and rejected
True or False: callback functions can handle both synchronous and asynchronous operations.
True
An operator used only inside of an async function that halts the execution of a function until a given promise is no longer pending and returns the resolved value of the promise.
await
The modern API for making a request from our JavaScript.
The fetch() API
A particular style of JavaScript (such as callbacks, promises, and async/await), that allows you to perform long network requests without blocking the main thread.
Asynchronous
Used with a success handler callback containing the logic for what should happen if a promise resolves.
.then()
How we would pass callback into myFunction as a callback function.
const callback = () => {. . .};
const myFunction = callback => {. . .};
myFunction(callback);
In order to use the await keyword, we have to wrap it within this kind of function.
Asynchronous
Type of HTTP method is used to read or retrieve a resource from an API.
GET
What HTTP stands for
Hypertext Transfer Protocol
Used with a failure handler callback containing the logic for what should happen if a promise rejects.
.catch()
The amount of time that would pass before the anonymous callback function would queue for execution.
setTimeout(()=>console.log("Hello learners!"), 11000);
11 seconds
The result of the following code:
async function myFunction() {
return 'hello world';
}
myFunction()
.then((resolvedValue) => {
console.log(resolvedValue);
})
'hello world' is printed to the console
The type of data that the GET and POST requests send and receive.
Objects
Built-in Node JavaScript function that sets a timer which queues a function or piece of code for execution when the timer expires
setTimeout()
Data type of the fulfilled value of Promise.all() ?
an Array
A term for the situation a programmer finds themself in when they nest too many callback functions inside of one another like the following example:
firstRequest(function(response) {
secondRequest(response,function(nextResponse) {
thirdRequest(nextResponse, function(finalResponse) {
console.log('Final response: ' + finalResponse);
}, failureCallback);
}, failureCallback);
}, failureCallback);
Callback Hell
The two possible {} block statements that follow a try block statement (One of the two is required, but there are two possibilities)
Catch and finally
The two possible parameters to a fetch statement (First one is required, second one is optional)
The URL, and options or init object
What an async function returns
async function example() { }
A promise