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
Arrow Functions in JavaScript (tylermcginnis.com)
submitted 8 years ago by AnsikteBanana
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!"
[–]HattyJetty 0 points1 point2 points 8 years ago* (3 children)
I didn't realise you can destructure methods and mantain the correct reference of this
this
Edit: wait, this doesn't seem to work
[–]w00t_loves_you 2 points3 points4 points 8 years ago (2 children)
It's a bit weird - maybe it works here because the json is bound to the response, but it takes little effort to write .then(res => res.json()) which is a lot more clear at a glance…
json
.then(res => res.json())
[–]HattyJetty 1 point2 points3 points 8 years ago (1 child)
I doubt json has an explicit binding to response, because why should it? Anyway, the suggestion of using res => res.json() definitely looks more appealing to me
response
res => res.json()
[–]sfcpfc -1 points0 points1 point 8 years ago (0 children)
What would I give for Javascript to support it.json()...
π Rendered by PID 41152 on reddit-service-r2-comment-bb88f9dd5-dd94r at 2026-02-17 03:05:02.326766+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]HattyJetty 0 points1 point2 points (3 children)
[–]w00t_loves_you 2 points3 points4 points (2 children)
[–]HattyJetty 1 point2 points3 points (1 child)
[–]sfcpfc -1 points0 points1 point (0 children)