How to make HTTP requests using "fetch"
Hello ๐
Method 1 - Promise
fetch('https://randomuser.me/api/')
.then(res => res.json())
.then(data => {
console.log(data)
})
Method 2 - Async
const response = await fetch('https://randomuser.me/api/')
const data = response.json()
console.log(da...
h.dhairyashah.dev1 min read