Created
February 8, 2022 21:18
-
-
Save patrickhulce/0c4c7b6b05937b6854b048a20b7ddb6c to your computer and use it in GitHub Desktop.
Revisions
-
patrickhulce created this gist
Feb 8, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ let x = 0; new Promise(resolve => resolve()).then(() => { x = 1 new Promise(resolve => resolve()).then(() => { x = 2 }) }) await flushAllMicrotasks() console.log(x) // This will print `2` instead of `0`.