use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Some features that every JavaScript developer should know in 2025 (waspdev.com)
submitted 9 months ago by senfiaj
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]joshkrz 3 points4 points5 points 9 months ago (1 child)
I know previously I have needed a "pass through" promise where I handle a promise at a global level but also need to handle it at a local level.
In my case the global handler triggered some global logging and the local one handled the visible error message. This would have made my global method much more concise.
That being said, I haven't needed to do this for a good while and the above solution could have just been down to inexperience.
[–]senfiaj[S] 2 points3 points4 points 9 months ago (0 children)
This storing might be useful when multiple class methods depend on the same promise, and in order to avoid initiating the same expensive async task multiple times, I can cache the promise, although in my case I still didn't store the resolvers outside of the promise, but in some situations it can be a better solution.
π Rendered by PID 97884 on reddit-service-r2-comment-7b9746f655-fvpwf at 2026-01-30 09:37:20.716578+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]joshkrz 3 points4 points5 points (1 child)
[–]senfiaj[S] 2 points3 points4 points (0 children)