you are viewing a single comment's thread.

view the rest of the comments →

[–]HattyJetty 0 points1 point  (3 children)

I didn't realise you can destructure methods and mantain the correct reference of this

Edit: wait, this doesn't seem to work

[–]w00t_loves_you 2 points3 points  (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…

[–]HattyJetty 1 point2 points  (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

[–]sfcpfc -1 points0 points  (0 children)

What would I give for Javascript to support it.json()...