Skip to content

Commit 0b2c1bc

Browse files
committed
Add doc comment to FileList.item with iteration example
1 parent b32895f commit 0b2c1bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/DOMAPI/FileList.res

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ open FileAPI
22
open DOMAPI
33

44
/**
5+
Returns the `File` at the specified index.
6+
7+
`FileList` is not an array, so you need to iterate manually using `length` and `item`:
8+
9+
```rescript
10+
let files = []
11+
for i in 0 to fileList.length - 1 {
12+
files->Array.push(fileList->FileList.item(i))
13+
}
14+
```
15+
516
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileList/item)
617
*/
718
@send

0 commit comments

Comments
 (0)