I seem to be getting a PromiseValue: undefined error for my "Visitor Count".
I am trying to get data from my API so it updates everytime i go on my website/visit the API link. My Lambda and API gateway are both set up properly but I think there is something wrong with my Javascript code which is why i get this undefined message.
Is anyone able to provide me some insight why I am getting this message and how i am able to resolve it?
Promise {<pending>}
__proto__: Promise
catch: ƒ catch()
constructor: ƒ Promise()
finally: ƒ finally()
then: ƒ then()
Symbol(Symbol.toStringTag): "Promise"
__proto__: Object
[[PromiseStatus]]: "resolved"
[[PromiseValue]]: undefined
Visitor Count:undefined
fetch('api link here')
.then(function(sitevisits)
{
console.log("Visitor Count:" +
sitevisits.visits);
document.querySelector("#Visitors-text").innerHTML = "Total Visitors"+
sitevisits.visits;
});