for example i got one variable which will be updated after finishing ajax request.
Is there another way to implement it without using async function? How to implement "wait" function in es5,es6?
let a = false;
setTimeout(()=>{
a = true;
},10000);
(async function(){
while(!a)
{
await new Promise(resolve=>{setTimeout(()=>{
resolve('pause');
},5)})
}
console.log(a);
}(a))