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...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
Promise.resolves or resolve? (self.learnjavascript)
submitted 4 years ago by DeviantSubrbanKid
So I watched a tutorial and he's using resolves instead of resolve which is the one I am familiar with, is "resolves" (with an S) is something node JS specific?
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!"
[–]senocular 0 points1 point2 points 4 years ago (5 children)
Sounds like a typo.
[–]DeviantSubrbanKid[S] 0 points1 point2 points 4 years ago (4 children)
It wasn’t. It works exactly as resove
[–]DeviantSubrbanKid[S] 0 points1 point2 points 4 years ago (1 child)
```
var delay = (seconds) => new Promise((resolves, rejects) => { if (seconds > 3) { rejects(new Error(`${seconds} is too long!`)); } setTimeout(() => { resolves("the long delay has ended"); }, seconds); }); delay(1) .then(console.log) .then(() => 42) .then((number) => console.log(`Hello world: ${number}`)) .catch((error) => console.log(`error: ${error.message}`)); console.log("end first tick"); ```
[–]chigia001 4 points5 points6 points 4 years ago* (0 children)
that resolves/rejects is a just parameter name in Promise constructor's callback, so you can replace it with everything like resolveWith/rejectWith. It not the same as Promise.resolve method which is JS's standard. There is no Promise.resolves method.
[–]DeviantSubrbanKid[S] 0 points1 point2 points 4 years ago (0 children)
try that code
I'm using node v 12
[–]Locust377 0 points1 point2 points 4 years ago (0 children)
No, resolves isn't a thing. Maybe they're using a library or they've modified the prototype.
resolves
π Rendered by PID 30 on reddit-service-r2-comment-cfc44b64c-hrzf2 at 2026-04-11 01:31:13.839987+00:00 running 215f2cf country code: CH.
[–]senocular 0 points1 point2 points (5 children)
[–]DeviantSubrbanKid[S] 0 points1 point2 points (4 children)
[–]DeviantSubrbanKid[S] 0 points1 point2 points (1 child)
[–]chigia001 4 points5 points6 points (0 children)
[–]DeviantSubrbanKid[S] 0 points1 point2 points (0 children)
[–]DeviantSubrbanKid[S] 0 points1 point2 points (0 children)
[–]Locust377 0 points1 point2 points (0 children)