cannot set property on fetch response
in the browser this works
but not in deno js
2 Replies
ok i just tested it, it works also in deno js but it gets not logged when i log the object
In Deno, the
fetch()
function returns a Response
object that is based on the web standard Fetch API. According to the documentation, the Response
object is read-only and its properties cannot be modified. This is why you cannot set a new property on a Response
object in Deno.
In your example, you're trying to set a new property asdf
on the Response
object o
. This is not allowed in Deno, hence it doesn't work.
If you need to store additional information related to a response, consider using a separate variable or data structure.