r/ProgrammerHumor • • Jan 30 '26

Other maybeUseTheOriginHeaderInstead

Post image
37 Upvotes

13 comments sorted by

View all comments

Show parent comment

4

u/turtle_mekb Feb 15 '26

.then(json) only works if json is already a defined variable, like JSON.stringify

2

u/jessepence Feb 15 '26

Yeah, the problem is that the response object is not instantiated until after the first promise is fulfilled. So, there's no way to get a reference to the Response's JSON method because it doesn't exist yet.