Please, consider the code sample below, and focus on variable assignments. Since I have never seen such form in C++, what does the following mean: “upload” in new XMLHttpRequest`.
I would need a good explanation of what does the following statement mean: progress: "upload" in new XMLHttpRequest. Especially, the in is not in C++ present. What is that in supposed to do?
tests = {
filereader: typeof FileReader != 'undefined',
dnd: 'draggable' in document.createElement('span'),
formdata: !!window.FormData,
progress: "upload" in new XMLHttpRequest
};
thank you.
Chapter 11.8.7 – The
inoperator sayswhich means that
is true when
rvalis an object and it has a property namedString(lval).inis also used infor (... in ...)loops but that is just similar syntax, not a use of this operator.This is asking “does an
XMLHttpRequestinstance have a property named ‘upload’?” It’s effectively checking whether this browser has a particular feature which might not be present on all browsers.uploadin particular is specified in XMLHttpRequest Level 2 as an object that supports certain event handler to let you monitor the progress of an upload: