JavaScript Promise

let cc = await new Promise((resolve, reject) => {
    fetch('https://api.exchangeratesapi.io/latest')
    .then(response => {
        response.json().then(r => {
            resolve(r) // reject(r)
        })
    })
})
⚑ Tanggapan