diff --git a/docs/compat/reference/array/forEach.md b/docs/compat/reference/array/forEach.md index ae8b70284..112259c7b 100644 --- a/docs/compat/reference/array/forEach.md +++ b/docs/compat/reference/array/forEach.md @@ -16,7 +16,7 @@ forEach(collection, callback); ## Usage -### `forEach(collection, callback)` +### `forEach(collection, callback?)` Use `forEach` when you want to iterate over all elements of an array or object and execute a callback function for each element. The iteration stops if the callback returns `false`. @@ -79,7 +79,7 @@ forEach(undefined, value => { #### Parameters - `collection` (`ArrayLike | Record | null | undefined`): The array or object to iterate over. -- `callback` (`(value: T, index: number | string, collection: any) => void | false`): The function to execute for each element. Returns `false` to stop iteration. +- `callback` (`(value: T, index: number | string, collection: any) => void | false`, optional): The function to execute for each element. Returns `false` to stop iteration. Default is the `identity` function. #### Returns diff --git a/docs/compat/reference/array/forEachRight.md b/docs/compat/reference/array/forEachRight.md index 61f4afc83..d5ea66250 100644 --- a/docs/compat/reference/array/forEachRight.md +++ b/docs/compat/reference/array/forEachRight.md @@ -16,7 +16,7 @@ forEachRight(collection, callback); ## Usage -### `forEachRight(collection, callback)` +### `forEachRight(collection, callback?)` Iterates through each element of an array, object, or string from right to left and executes the given callback function. The iteration stops if the callback returns `false`. diff --git a/docs/ja/compat/reference/array/forEach.md b/docs/ja/compat/reference/array/forEach.md index 674e75a0f..85368a629 100644 --- a/docs/ja/compat/reference/array/forEach.md +++ b/docs/ja/compat/reference/array/forEach.md @@ -16,7 +16,7 @@ forEach(collection, callback); ## 使用法 -### `forEach(collection, callback)` +### `forEach(collection, callback?)` 配列またはオブジェクトのすべての要素を走査し、各要素に対してコールバック関数を実行したい場合は`forEach`を使用してください。コールバックが`false`を返すと走査を中断します。 @@ -79,7 +79,7 @@ forEach(undefined, value => { #### パラメータ - `collection` (`ArrayLike | Record | null | undefined`): 走査する配列またはオブジェクトです。 -- `callback` (`(value: T, index: number | string, collection: any) => void | false`): 各要素に対して実行する関数です。`false`を返すと走査を中断します。 +- `callback` (`(value: T, index: number | string, collection: any) => void | false`, 選択): 各要素に対して実行する関数です。`false`を返すと走査を中断します。デフォルトは`identity`関数です。 #### 戻り値 diff --git a/docs/ja/compat/reference/array/forEachRight.md b/docs/ja/compat/reference/array/forEachRight.md index c6d6baeff..107640120 100644 --- a/docs/ja/compat/reference/array/forEachRight.md +++ b/docs/ja/compat/reference/array/forEachRight.md @@ -16,7 +16,7 @@ forEachRight(collection, callback); ## 使用法 -### `forEachRight(collection, callback)` +### `forEachRight(collection, callback?)` 配列、オブジェクト、文字列を右から左の順序で走査し、各要素に対してコールバック関数を実行します。コールバックが`false`を返すと走査を中断します。 diff --git a/docs/ko/compat/reference/array/forEach.md b/docs/ko/compat/reference/array/forEach.md index 6e1116f8f..64764079e 100644 --- a/docs/ko/compat/reference/array/forEach.md +++ b/docs/ko/compat/reference/array/forEach.md @@ -16,7 +16,7 @@ forEach(collection, callback); ## 사용법 -### `forEach(collection, callback)` +### `forEach(collection, callback?)` 배열이나 객체의 모든 요소를 순회하면서 각 요소에 대해 콜백 함수를 실행하고 싶을 때 `forEach`를 사용하세요. 콜백이 `false`를 반환하면 순회를 중단해요. @@ -79,7 +79,7 @@ forEach(undefined, value => { #### 파라미터 - `collection` (`ArrayLike | Record | null | undefined`): 순회할 배열이나 객체예요. -- `callback` (`(value: T, index: number | string, collection: any) => void | false`): 각 요소에 대해 실행할 함수예요. `false`를 반환하면 순회를 중단해요. +- `callback` (`(value: T, index: number | string, collection: any) => void | false`, 선택): 각 요소에 대해 실행할 함수예요. `false`를 반환하면 순회를 중단해요. 기본값은 `identity` 함수예요. #### 반환 값 diff --git a/docs/ko/compat/reference/array/forEachRight.md b/docs/ko/compat/reference/array/forEachRight.md index 545a90754..3c056a3ba 100644 --- a/docs/ko/compat/reference/array/forEachRight.md +++ b/docs/ko/compat/reference/array/forEachRight.md @@ -16,7 +16,7 @@ forEachRight(collection, callback); ## 사용법 -### `forEachRight(collection, callback)` +### `forEachRight(collection, callback?)` 배열, 객체, 문자열을 오른쪽에서 왼쪽 순서로 순회하면서 각 요소에 대해 콜백 함수를 실행해요. 콜백이 `false`를 반환하면 순회를 중단해요. diff --git a/docs/zh_hans/compat/reference/array/forEach.md b/docs/zh_hans/compat/reference/array/forEach.md index fe7a1fffa..162bbe9f7 100644 --- a/docs/zh_hans/compat/reference/array/forEach.md +++ b/docs/zh_hans/compat/reference/array/forEach.md @@ -16,7 +16,7 @@ forEach(collection, callback); ## 用法 -### `forEach(collection, callback)` +### `forEach(collection, callback?)` 当您想遍历数组或对象的所有元素并对每个元素执行回调函数时,请使用 `forEach`。如果回调返回 `false`,则停止遍历。 @@ -79,7 +79,7 @@ forEach(undefined, value => { #### 参数 - `collection` (`ArrayLike | Record | null | undefined`): 要遍历的数组或对象。 -- `callback` (`(value: T, index: number | string, collection: any) => void | false`): 对每个元素执行的函数。返回 `false` 以停止遍历。 +- `callback` (`(value: T, index: number | string, collection: any) => void | false`, 可选): 对每个元素执行的函数。返回 `false` 以停止遍历。默认值是 `identity` 函数。 #### 返回值 diff --git a/docs/zh_hans/compat/reference/array/forEachRight.md b/docs/zh_hans/compat/reference/array/forEachRight.md index c61342c0a..33bff82a2 100644 --- a/docs/zh_hans/compat/reference/array/forEachRight.md +++ b/docs/zh_hans/compat/reference/array/forEachRight.md @@ -16,7 +16,7 @@ forEachRight(collection, callback); ## 用法 -### `forEachRight(collection, callback)` +### `forEachRight(collection, callback?)` 从右到左顺序遍历数组、对象或字符串,并对每个元素执行回调函数。如果回调返回 `false`,则停止遍历。