Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save clicktechnology/5144fe2824ac1a97dbc3dd723c9c7fb5 to your computer and use it in GitHub Desktop.
Save clicktechnology/5144fe2824ac1a97dbc3dd723c9c7fb5 to your computer and use it in GitHub Desktop.
// JavaScript / NodeJS - Fetch using promises
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