The standard is thick
so let’s begin with a very simple example. only 9 lines, only need
  1. function
  1. print a.k.a console.log
  1. new Promise <= we will talk about
  1. method call, here is .catch
  1. no setTimeout
so it just run through the res and rej
and out of the Promise, the catch works, catch the rej, no error
the procedure
so the function did execute, but not the job, which come into the event loop wait until free.
so it isn’t a builder pattern.
 
and the res and rej do some side effect, they enqueue the res and rej.
 
one more proof
the 5 will be print twice at the end 🙂
 
Loading...
Steven Lynn
Steven Lynn
喂马、劈柴、周游世界
最新发布
我与 Dify 的半年
2025-3-9
我的2022年终小结
2024-11-9
记录雅思考试经历与一点学习心得
2024-11-9
Hackergame 2024 思路小结
2024-11-9
黑客松、日本、入职:我的2024下半年的总结
2024-11-9
NotionNext:基于Notion和NextJS的开源博客
2024-11-9