Javascript Fetch Api Json Sample

February 9, 2020

Callback

fetch(url).then(response => response.json()).then(data => {
    console.log(data)
})

Async

const response = await fetch(url)
const data = await response.json()
console.log(data)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.