Created
November 8, 2021 21:07
-
-
Save clicktechnology/5144fe2824ac1a97dbc3dd723c9c7fb5 to your computer and use it in GitHub Desktop.
// JavaScript / NodeJS - Fetch using promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myPromise = fetch('https://jsonplaceholder.typicode.com/todos/4'); | |
myPromise | |
.then(response => response.json()) | |
.then(user => console.log(':-) | ', user.title, user.id, user.completed)) | |
.catch(err => console.log(':-( | ', err)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment