DEV Community

Discussion on: [Challenge] log("this") or log("this").withData({})

Collapse
 
nombrekeff profile image
Keff

I guess. The only way I figured it out was making use of setTimeout, but, as you explained in another comment, it's not 100% guaranteed it will always work and can behave in unexpected ways.

Hopefully, somebody comes up with some weird solutions :)

Collapse
 
pyrsmk profile image
Aurélien Delogu

That is something I did in a technical test for a job interview. Why couldn't we use the event loop mechanism to trigger something as soon as we exit the function ?

Nevertheless, that was not they were expecting ahah.