Last active
September 6, 2024 01:44
-
-
Save steveast/85f7eaf8a1c8e1389eaccc3e91cb11e1 to your computer and use it in GitHub Desktop.
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 characters
Очередь синхронного кода (callstack) | |
Очередь микрозадач (Promise) | |
Отдельная очередь браузера для отрисовки содержимого (requestAnimationFrame) | |
Очередь макрозадач (setTimeout() и setInterval() или AJAX-запросы) | |
requestAnimationFrame(() => console.log('1 animation frame')); | |
setTimeout(() => console.log('2 timeout'), 0); | |
Promise.resolve().then(() => console.log('3 promise')); | |
console.log('4 sync'); | |
// 4 sync | |
// 3 promise | |
// 1 animation frame | |
// 2 timeout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment