Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct descriptions of the asynchronous iterator methods on FileSystemDirectoryHandle #29012

Merged
merged 8 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions files/en-us/web/api/filesystemdirectoryhandle/entries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ browser-compat: api.FileSystemDirectoryHandle.entries
{{securecontext_header}}{{APIRef("File System API")}}

The **`entries()`** method of the
{{domxref("FileSystemDirectoryHandle")}} interface returns an array of a given object's
own enumerable property `[key, value]` pairs, in the same order as that
provided by a [`for...in`](/en-US/docs/Web/JavaScript/Reference/Statements/for...in) loop (the difference being that a for-in loop
enumerates properties in the prototype chain as well).
{{domxref("FileSystemDirectoryHandle")}} interface returns a new asynchronous iterator
for the iteration of the key-value pairs of the entries within the `FileSystemDirectoryHandle`
on which this method is called. The order of iteration is vague. The key-value pairs are
in the form of an array like `[key, value]`.

## Syntax

Expand All @@ -26,11 +26,12 @@ None.

### Return value

An array of the given `FileSystemDirectoryHandle` object's own enumerable
property `[key, value]` pairs.
A new asynchronous iterator containing the key-value pairs of each entry within the `FileSystemDirectoryHandle`.

## Examples

Use the `for await...of` loop can simplify the iteration process.

```js
const dirHandle = await window.showDirectoryPicker();

Expand Down
9 changes: 6 additions & 3 deletions files/en-us/web/api/filesystemdirectoryhandle/keys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ browser-compat: api.FileSystemDirectoryHandle.keys
{{securecontext_header}}{{APIRef("File System API")}}

The **`keys()`** method of the
{{domxref("FileSystemDirectoryHandle")}} interface returns a new _array iterator_
containing the keys for each item in `FileSystemDirectoryHandle`.
{{domxref("FileSystemDirectoryHandle")}} interface returns a new asynchronous iterator
for the iteration of the key of the entries within the `FileSystemDirectoryHandle`
on which this method is called. The order of iteration is vague.

## Syntax

Expand All @@ -24,10 +25,12 @@ None.

### Return value

A new {{jsxref('Array')}}
A new asynchronous iterator containing the keys of each entry within the `FileSystemDirectoryHandle`.

## Examples

Use the `for await...of` loop can simplify the iteration process.

```js
const dirHandle = await window.showDirectoryPicker();

Expand Down
10 changes: 6 additions & 4 deletions files/en-us/web/api/filesystemdirectoryhandle/values/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ browser-compat: api.FileSystemDirectoryHandle.values
{{securecontext_header}}{{APIRef("File System API")}}

The **`values()`** method of the
{{domxref("FileSystemDirectoryHandle")}} interface returns a new _array iterator_
containing the values for each index in the `FileSystemDirectoryHandle`
object.
{{domxref("FileSystemDirectoryHandle")}} interface returns a new asynchronous iterator
for the iteration of the value of the entries within the `FileSystemDirectoryHandle`
on which this method is called. The order of iteration is vague.

## Syntax

Expand All @@ -25,10 +25,12 @@ None.

### Return value

A new {{jsxref('Array')}}
A new asynchronous iterator containing the handles of each entry within the `FileSystemDirectoryHandle`.

## Examples

Use the `for await...of` loop can simplify the iteration process.

```js
const dirHandle = await window.showDirectoryPicker();

Expand Down