<!DOCTYPE html> <html> <body> <button id="myBtn">Try it</button> <script> button=document.getElementById("myBtn") button.addEventListener("click", function(){ Promise.resolve().then(()=>console.log('Microtask 1')); console.log('1'); }); button.addEventListener("click", function(){ Promise.resolve().then(()=>console.log('Microtask 2')); console.log('2'); }); //button.click(); //not the same as click from the user... ..JsStacks and MicroTasks </script> </body> </html>
Monday, February 17, 2020
JsStacks and MicroTasks, Can you guess the order of the prints?
Subscribe to:
Post Comments (Atom)
-
sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...
-
Known Issues Firefox 3.5 will only support color profiles as specified by ICC v2, later versions will add su...
No comments:
Post a Comment