DEV Community

Discussion on: What is the oddest JavaScript behavior?

Collapse
 
camdhall profile image
CamDHall • Edited

I ran into this issue last night. I understood my brain fart of a problem pretty quickly, but sometimes surprising things aren't necessarily new lol.

this.data = await RequestHandler('url-i-was-hitting');

console.log(this.data); // returns undefined

var temp = await RequestHandler('url-i-was-hitting');

console.log(temp) // json I was expecting