I make fetch request in javascript . It is fetching data when I seed console it show me data. but when I try to alert it in then function it displays empty. it show alert promptly with page load. I think it alerting before request response
Here is my javascript code
fetch("https://01b4e41e6262.ngrok.io/api/get_schedule_orders/" + gUser.getData().id).then(res => {
if (res.ok) {
alert(res)
}
});