javascript setTimeout being evaluated and messing with the variables in the background? -


code:

oncallofthisfunc() {  settimeout(() => {   if(myvar.length===0) {    this.error()   }  },3000) } 

but problem when other function executed, assume success, this.error being run in background , refer updated var it'll return error. , it's rerun new vars(which not error) settimeout before return error, want stop executing in background?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -