Skip to content

Commit

Permalink
Correct descriptions of the asynchronous iterator methods on `FileSys…
Browse files Browse the repository at this point in the history
…temDirectoryHandle` (#29012)

* Correct descriptions

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix typo

* Update files/en-us/web/api/filesystemdirectoryhandle/keys/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* delete line breaks in list

* improve

* improve

* Apply suggestions from code review

Co-authored-by: Florian Scholz <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Florian Scholz <[email protected]>
3 people authored Nov 6, 2023
1 parent 4dfab8a commit ebd6de7
Showing 3 changed files with 19 additions and 13 deletions.
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
@@ -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 key-value pairs are
in the form of an array like `[key, value]`.

## Syntax

@@ -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();

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
@@ -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.

## Syntax

@@ -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();

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
@@ -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.

## Syntax

@@ -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();

0 comments on commit ebd6de7

Please sign in to comment.