After converting a response stream into JSON, are the two exactly the same?
const responseA = fetch(endpointReturnsJson)
const textA = await responseA.text()
In a parallel universe...
const responseA = fetch(endpointReturnsJson)
const json = await responseA.json()
const textB = JSON.stringify(json)
I understand that textB will likely include serialization of characters such as {\\
Is there anything else?
awaitin front of bothfetchandresponse.json/response.text. And assuming the response was valid JSON in the first place:JSON.parse(await response.text())should give the same result asawait response.json(), but not necessarily the other way round because for example the whitespace may be different.