Hacker News new | ask | show | jobs
by paulddraper 333 days ago
Huh?

It creates 1 object allocation per enqueue.

1 comments

yeah but it creates closure as well, which typically references some objects that isn't easy to GC. So if you have long-living promise with some data captured in closure, it will not be cleared. So doing then().then().then() may not release objects referenced in callbacks that resolved time ago.
There are zero closures here.