Well, there may be several reasons. For example, if it were an array, you could change it. You cannot modify an instance of FileList . Secondly, but related, it may be (probably is) an idea of ββthe browser data structure, so a minimal set of features makes implementation easier.
Update in 2018: Interestingly, there is a note on the FileList in the specification :
The FileList interface should be considered as "at risk" since the general trend on the web platform is to replace such interfaces with an Array platform object in ECMAScript [ECMA-262]. In particular, this means that syntax of the form filelist.item(0) is at risk; Most other FileList software applications FileList unlikely to be affected by a possible switch to the Array type.
(What I find strange, I thought the trend was towards iterable , not Array - such as an update to NodeList marking it as iterable for compatibility with the extension syntax, for-of and forEach .)
You can also convert it to an array via Array.from(theFileList) .
Tj crowder
source share