Promises work similarly
const myPromise = fetch("https://some-url.com");
myPromise
.then(response => { return response.json() }) // Method call
.then(response => { console.log(response) }) // Method call
- A Promise is an object (can be stored in a variable)
.then
is a method- You can chain
.then
s to do things in order - You don't need to understand this super deeply for now
23 / 25