The short answer is “because JavaScript is poorly designed”. The longer answer is in here: arrow functions inherit this
from their point of definition, whereas when you assign onFileResponse
as an ordinary function, its execution context (what this
means) is at the whim of the point of call.
1 Like