I don't understand how the courses array updates with an app.put request

I’ll try my best to formulate my question as clearly as possible. (Referring to the 'handling http put requests video)

We can do an app.get(‘/api/courses’) request which sends back an array of courses we have defined as a const earlier.

Now, with an app.put request, to me it seems like we are simply finding the original course by id using the .find method on the courses array, and then we update that returned value and send the updated value back. But nowhere in the code do we actually alter the data within the courses array which has been defined earlier? So how come when we run app.get(‘/api/courses’) once again, we see the updated course info? It simply sends back the courses array which has not been altered? Im a little bit lost here, hope the question makes sense.