Open gitspeaks opened 8 months ago
In Live Preview, console.log
will do some extra calls to show them in the Embedded Live Preview Console
, so this is very possible. Curious: how exactly can this code tell which event loop cycle some code runs on?
Consider the following:
After clicking the button, both Chrome and Firefox immediately display 'test' in the developer console. In contrast, 'Live Preview' shows the string in the output pane after a 10-second delay. This behavior suggests that in 'Live Preview', console.log output is processed in the next event loop cycle, rather than in the current one as typically expected.