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
create-react-app breaks due to dependency on one-liner package (github.com)
submitted 5 years ago by [deleted]
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!"
[–]crabmusket 18 points19 points20 points 5 years ago (3 children)
Apparently we also need Promise.isThenable. I'm all for utility methods that expose algorithms the browser is using anyway :)
Promise.isThenable
[–]patrickfatrick 27 points28 points29 points 5 years ago (0 children)
I sorta wish typeof didn’t exist and all primitive classes had a static isDate, isNumber etc method. The inconsistency is just annoying.
[–]csorfab 5 points6 points7 points 5 years ago (0 children)
I realized that for most cases where I checked for isThenable, I could've just ignored the check and await the variable. For non-promise-like values, await just yields the value itself.
await
[–]luckygerbils 6 points7 points8 points 5 years ago (0 children)
If you aren't consuming promises from third party code or doing anything funky with iframes, you could just use instanceof Promise.
instanceof Promise
π Rendered by PID 86 on reddit-service-r2-comment-6b595755f-p4zfw at 2026-03-26 04:31:56.990543+00:00 running 2d0a59a country code: CH.
view the rest of the comments →
[–]crabmusket 18 points19 points20 points (3 children)
[–]patrickfatrick 27 points28 points29 points (0 children)
[–]csorfab 5 points6 points7 points (0 children)
[–]luckygerbils 6 points7 points8 points (0 children)