The image is then configured to allow cross-origin downloading by setting its crossOrigin attribute to "Anonymous" (that is, allow non-authenticated downloading of the image cross-origin). To speed things up even further, some sites also store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downloading fresh copies every time the page is first loaded. This function will be called when the response text is ready, and inside it we will update our
 block with the text. First, the promise, returned by fetch, resolves with an object of the built-in Response class as soon as the server responds with headers. In the pump() function seen above we first invoke read(), which returns a promise containing a results object  this has the results of our read in it, in the form { done, value }: The results can be one of three different types: Next, we check whether done is true. To find out how to do this, read our guide to setting up a local testing server. This will also help us answer your question better. It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. How can I remove a specific item from an array in JavaScript? The basic syntax is: let promise = fetch( url, [ options]) url - the URL to access. If you visit another page, the browser requests the new files, and the server responds with them. A local development environment for Node.js.   Copy code. DEV Community  A constructive and inclusive social network for software developers. For example, our Simple stream pump example goes on to enqueue each chunk in a new, custom ReadableStream (we will find more about this in the next section), then create a new Response out of it, consume it as a Blob, create an object URL out of that blob using URL.createObjectURL(), and then display it on screen in an  element, effectively creating a copy of the image we originally fetched. The value of the