MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1qqxmi8/maybeusetheoriginheaderinstead/o5g4qs4/
r/ProgrammerHumor • u/MurkyWar2756 • Jan 30 '26
13 comments sorted by
View all comments
Show parent comment
4
.then(json) only works if json is already a defined variable, like JSON.stringify
.then(json)
json
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.
2
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.
View all comments
Show parent comment
4
u/turtle_mekb Feb 15 '26
.then(json)only works ifjsonis already a defined variable, likeJSON.stringify