First of all, apologies for the simplicity of this question.
I am at the beginning of the chapter looking at the code below.
I have been sitting here trying to figure this code out for half an hour and I cannot figure it out, so I would appreciate if someone could explain it to me. I understand that createServer() takes in a function as a parameter, and that we are instantiating that function as we go (an anonymous function). However, what I don’t understand are the parameters for this anonymous function. It takes in the parameters ‘req’ and ‘res’. We haven’t defined these variables before, and these are some of the first lines that our code runs at all. So what can possibly be stored in these variables, and how did those values get there?