Skip to content

Instantly share code, notes, and snippets.

@herecydev
Created August 25, 2019 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herecydev/3bc3bb0bb6e3fc6d053352b685cec64f to your computer and use it in GitHub Desktop.
Save herecydev/3bc3bb0bb6e3fc6d053352b685cec64f to your computer and use it in GitHub Desktop.
const apiCall = async () => {
let response = await fetch("https://jsonplaceholder.typicode.com/todos/1");
let json = await response.json();
console.log(json)
}
<input type="button" value="Click me" onClick="apiCall()" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment