In the anonymous function attached to the
xhr.onreadystatechange event, we have an
if statement to check whether our request has a
readyState equal to
From everything I’ve read
XMLHttpRequest.DONE === 4, so why do we rely on this way of “getting to 4”, rather than just using 4?
I also can’t seem to find any documentation anywhere about how the
.DONE property of the
XMLHttpRequest works, why it’s capitalised, what other ones are available, etc.
Thanks for any input!