diff --git a/en/application-dev/reference/apis/js-apis-arraylist.md b/en/application-dev/reference/apis/js-apis-arraylist.md index 0cd79c938c8bb74f7fb919c7e6dc2e1afaa97cd8..f9012db2add74f9810baa032b103a4eff48dbd04 100644 --- a/en/application-dev/reference/apis/js-apis-arraylist.md +++ b/en/application-dev/reference/apis/js-apis-arraylist.md @@ -379,15 +379,15 @@ Replaces all elements in this container with new elements, and returns the new o | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for the replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| arrlist | ArrayList<T> | No| Instance that invokes the **replaceAllElements** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| arrlist | ArrayList<T> | No| Instance that calls the **replaceAllElements** API. The default value is this instance.| **Error codes** @@ -425,15 +425,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for the replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| arrlist | ArrayList<T> | No| Instance that invokes the **forEach** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is 0.| +| arrlist | ArrayList<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** @@ -468,7 +468,7 @@ Sorts elements in this container. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| comparator | function | No| Callback invoked for sorting.| +| comparator | function | No| Callback invoked for sorting. The default value is the callback function for sorting elements in ascending order.| comparator diff --git a/en/application-dev/reference/apis/js-apis-buffer.md b/en/application-dev/reference/apis/js-apis-buffer.md index 737c9f1dbf05e30e2f84e185b89e804642b0c39f..f50bdfe83cca98808fbb79237bd21194ec30b7a4 100644 --- a/en/application-dev/reference/apis/js-apis-buffer.md +++ b/en/application-dev/reference/apis/js-apis-buffer.md @@ -204,7 +204,7 @@ Concatenates an array of **Buffer** instances of the specified length into a new | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | list | Buffer[] \| Uint8Array[] | Yes| Array of instances to concatenate.| -| totalLength | number | No| Total length of bytes to be copied.| +| totalLength | number | No| Total length of bytes to be copied. The default value is **0**.| **Return value** @@ -1915,7 +1915,7 @@ Converts the data at the specified position in this **Buffer** instance into a s | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| encoding | string | No| Encoding format of the string. The default value is **utf-8**.| +| encoding | string | No| Encoding format (valid only when **value** is a string). The default value is **utf-8**.| | start | number | No| Offset to the start position of the data to convert. The default value is **0**.| | end | number | No| Offset to the end position of the data to convert. The default value is the length of this **Buffer** instance.| diff --git a/en/application-dev/reference/apis/js-apis-deque.md b/en/application-dev/reference/apis/js-apis-deque.md index 7242e7dabbf12e7e44a98fa23bc44b9ead440a1e..24a211683113a62ae975f77ea86d5139c4aeffc8 100644 --- a/en/application-dev/reference/apis/js-apis-deque.md +++ b/en/application-dev/reference/apis/js-apis-deque.md @@ -242,15 +242,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| deque | Deque<T> | No| Instance that invokes the **forEach** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| deque | Deque<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-hashmap.md b/en/application-dev/reference/apis/js-apis-hashmap.md index c880644673fd9a8cd9d15ac05ec01afc9785bf3e..fc0a1e56470f7fb3a66a5feb1ad168b2c0fcea4a 100644 --- a/en/application-dev/reference/apis/js-apis-hashmap.md +++ b/en/application-dev/reference/apis/js-apis-hashmap.md @@ -459,14 +459,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | V | No| Value of the element that is currently traversed.| -| key | K | No| Key of the element that is currently traversed.| -| map | HashMap | No| Instance that invokes the **forEach** method.| +| value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.| +| map | HashMap | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-hashset.md b/en/application-dev/reference/apis/js-apis-hashset.md index df65bfcb4a3167ed9c9f2292065554a505e9f4e1..e396f5e4e5256a946c508b549cb183e35b439715 100644 --- a/en/application-dev/reference/apis/js-apis-hashset.md +++ b/en/application-dev/reference/apis/js-apis-hashset.md @@ -282,14 +282,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | T | No| Value of the element that is currently traversed.| -| key | T | No| Key of the element that is currently traversed (same as **value**).| -| set | HashSet<T> | No| Instance that invokes the **forEach** API.| +| value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key | T | No| Key of the element that is currently traversed (same as **value**). The default value is the key of the first key-value pair.| +| set | HashSet<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-lightweightmap.md b/en/application-dev/reference/apis/js-apis-lightweightmap.md index ed1848ad8df12b8a5526699908347ade635a9041..af435ce52e23abbca6d5f3777f2dadc82c4701d4 100644 --- a/en/application-dev/reference/apis/js-apis-lightweightmap.md +++ b/en/application-dev/reference/apis/js-apis-lightweightmap.md @@ -724,14 +724,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | V | No| Value of the element that is currently traversed.| -| key | K | No| Key of the element that is currently traversed.| -| map | LightWeightMap | No| Instance that invokes the **forEach** method.| +| value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.| +| map | LightWeightMap | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-lightweightset.md b/en/application-dev/reference/apis/js-apis-lightweightset.md index 05eba80d96783d32a427f1181bdc5b71bdab596b..7446c334dfa3022b943d1155e9bdab10e8e1e0a9 100644 --- a/en/application-dev/reference/apis/js-apis-lightweightset.md +++ b/en/application-dev/reference/apis/js-apis-lightweightset.md @@ -588,14 +588,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | T | No| Value of the element that is currently traversed.| -| key| T | No| Key of the element that is currently traversed (same as **value**).| -| set | LightWeightSet<T> | No| Instance that invokes the **forEach** method.| +| value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key| T | No| Key of the element that is currently traversed (same as **value**). The default value is the key of the first key-value pair.| +| set | LightWeightSet<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-linkedlist.md b/en/application-dev/reference/apis/js-apis-linkedlist.md index 14382577e7b3fb1881e74527b8ec31ab87a89169..fa13281b52c968658e016fd7ee82be77e570fd60 100644 --- a/en/application-dev/reference/apis/js-apis-linkedlist.md +++ b/en/application-dev/reference/apis/js-apis-linkedlist.md @@ -607,15 +607,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| LinkedList | LinkedList<T> | No| Instance that invokes the **forEach** API.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| LinkedList | LinkedList<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-list.md b/en/application-dev/reference/apis/js-apis-list.md index b7618d64c1d61a52324ada111347f666e7095c73..a9dd535c30efa333db867f444e28502f65ab8537 100644 --- a/en/application-dev/reference/apis/js-apis-list.md +++ b/en/application-dev/reference/apis/js-apis-list.md @@ -427,15 +427,15 @@ Replaces all elements in this container with new elements, and returns the new o | Name| Value Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for the replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Value Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| list | List<T> | No| Instance that invokes the **replaceAllElements** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| list | List<T> | No| Instance that calls the **replaceAllElements** API. The default value is this instance.| **Error codes** @@ -473,15 +473,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Value Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for the replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Value Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| List | List<T> | No| Instance that invokes the **forEach** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| List | List<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-plainarray.md b/en/application-dev/reference/apis/js-apis-plainarray.md index 14f73f6d4b11059551b376f7fcb9e56ee4e1ab84..5ce7718cc4bcb677a35f83079d9392d2b9d0ba0c 100644 --- a/en/application-dev/reference/apis/js-apis-plainarray.md +++ b/en/application-dev/reference/apis/js-apis-plainarray.md @@ -597,14 +597,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type | Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Key of the element that is currently traversed.| -| PlainArray | PlainArray<T>| No| Instance that invokes the **forEach** API.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| PlainArray | PlainArray<T>| No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-queue.md b/en/application-dev/reference/apis/js-apis-queue.md index c926b741543cd384f6c4b7649c2e8f1881883a55..ff4639e830aee3ba615858a38e3b8a84b12575a5 100644 --- a/en/application-dev/reference/apis/js-apis-queue.md +++ b/en/application-dev/reference/apis/js-apis-queue.md @@ -176,15 +176,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| Queue | Queue<T> | No| Instance that invokes the **forEach** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| Queue | Queue<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-stack.md b/en/application-dev/reference/apis/js-apis-stack.md index 9ecf69bced25271e1c68299bb78e2a19bbaab756..998d202a759c605a87b43997132a023a68188373 100644 --- a/en/application-dev/reference/apis/js-apis-stack.md +++ b/en/application-dev/reference/apis/js-apis-stack.md @@ -214,15 +214,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| stack | Stack<T> | No| Instance that invokes the **forEach** method.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| stack | Stack<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-treemap.md b/en/application-dev/reference/apis/js-apis-treemap.md index f05edc6533e92d21c49cf1dd2c91b7e9aa12ff0a..38f3d0525c9d7a35b33a808e0ae8fd38ea58bf4d 100644 --- a/en/application-dev/reference/apis/js-apis-treemap.md +++ b/en/application-dev/reference/apis/js-apis-treemap.md @@ -48,7 +48,7 @@ A constructor used to create a **TreeMap** instance. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| comparator | function | No| Custom comparator.| +| comparator | function | No| Custom comparator. The default value is **hole** (a blank placeholder), indicating that no comparator. is provided.| **Error codes** @@ -611,14 +611,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | V | No| Value of the element that is currently traversed.| -| key | K | No| Key of the element that is currently traversed.| -| map | TreeMap | No| Instance that invokes the **forEach** method.| +| value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.| +| map | TreeMap | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-treeset.md b/en/application-dev/reference/apis/js-apis-treeset.md index b3259d3ccbf19fab20c027accad98c6519bf7f52..fafe6553d2469bd19badd9ec5ce0814b12b02299 100644 --- a/en/application-dev/reference/apis/js-apis-treeset.md +++ b/en/application-dev/reference/apis/js-apis-treeset.md @@ -44,7 +44,7 @@ A constructor used to create a **TreeSet** instance. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| comparator | function | No| Custom comparator.| +| comparator | function | No| Custom comparator. The default value is **hole** (a blank placeholder), indicating that no comparator. is provided.| **Error codes** @@ -484,14 +484,14 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| -| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | T | No| Value of the element that is currently traversed.| -| key | T | No| Key of the element that is currently traversed.| -| set | TreeSet<T> | No| Instance that invokes the **forEach** method.| +| value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.| +| key | T | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.| +| set | TreeSet<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-util.md b/en/application-dev/reference/apis/js-apis-util.md index 6600939a007d9ac3abd1ad964f3270445cec3a7e..c049c8f2a2a4a3cc3a37bc47c5672da9cb4bb3fe 100755 --- a/en/application-dev/reference/apis/js-apis-util.md +++ b/en/application-dev/reference/apis/js-apis-util.md @@ -586,7 +586,7 @@ result = textEncoder.encodeInto("\uD800¥¥"); ### encodeIntoUint8Array9+ -encodeIntoUint8Array(input: string, dest: Uint8Array, ): { read: number; written: number } +encodeIntoUint8Array(input: string, dest: Uint8Array): { read: number; written: number } Stores the UTF-8 encoded text. @@ -617,7 +617,7 @@ result = that.encodeIntoUint8Array('abcd', dest) ### encodeInto(deprecated) -encodeInto(input: string, dest: Uint8Array, ): { read: number; written: number } +encodeInto(input: string, dest: Uint8Array): { read: number; written: number } Stores the UTF-8 encoded text. @@ -1100,7 +1100,7 @@ A constructor used to create a **LruCache** instance. The default capacity of th | Name | Type | Mandatory| Description | | -------- | ------ | ---- | ---------------------------- | -| capacity | number | No | Capacity of the **LruCache** to create.| +| capacity | number | No | Capacity of the **LruCache** to create. The default value is **64**.| **Example** @@ -3400,7 +3400,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| capacity | number | No| Capacity of the **LruBuffer** to create.| +| capacity | number | No| Capacity of the **LruBuffer** to create. The default value is **64**.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-vector.md b/en/application-dev/reference/apis/js-apis-vector.md index 7e59a7685b38a014a76065ee04255b106c9d8133..137cf7bfffa33bc4035ec80d10c7e09075b00ae1 100644 --- a/en/application-dev/reference/apis/js-apis-vector.md +++ b/en/application-dev/reference/apis/js-apis-vector.md @@ -304,15 +304,15 @@ Replaces all elements in this container with new elements, and returns the new o | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| vector | Vector<T> | No| Instance that invokes the **replaceAllElements** API.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| vector | Vector<T> | No| Instance that calls the **replaceAllElements** API. The default value is this instance.| **Example** @@ -342,15 +342,15 @@ Uses a callback to traverse the elements in this container and obtain their posi | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked for replacement.| -| thisArg | Object | No| Value to use when the callback is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.| -callbackfn +callbackFn | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | value | T | Yes| Value of the element that is currently traversed.| -| index | number | No| Position index of the element that is currently traversed.| -| vector | Vector<T> | No| Instance that invokes the **forEach** API.| +| index | number | No| Position index of the element that is currently traversed. The default value is **0**.| +| vector | Vector<T> | No| Instance that calls the **forEach** API. The default value is this instance.| **Example** @@ -378,7 +378,7 @@ Sorts elements in this container. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| comparator | function | No| Callback invoked for sorting.| +| comparator | function | No| Callback invoked for sorting. The default value is this instance.| comparator diff --git a/en/application-dev/reference/apis/js-apis-xml.md b/en/application-dev/reference/apis/js-apis-xml.md index f8e8f0fff5917b56be67e1f3ab0b21ac949e7ee3..9554f5b07dd9f131c81c7ef8e30df9813cc303e9 100644 --- a/en/application-dev/reference/apis/js-apis-xml.md +++ b/en/application-dev/reference/apis/js-apis-xml.md @@ -381,6 +381,7 @@ Creates and returns an **XmlPullParser** object. **Example** ```js +import util from '@ohos.util'; let strXml = '' + ']>' + @@ -432,6 +433,7 @@ Parses XML information. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -499,6 +501,7 @@ Obtains the column line number, starting from 1. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -542,6 +545,7 @@ Obtains the depth of this element. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -588,6 +592,7 @@ Obtains the current line number, starting from 1. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -631,6 +636,7 @@ Obtains the name of this element. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -673,6 +679,7 @@ Obtains the namespace of this element. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -715,6 +722,7 @@ Obtains the prefix of this element. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -758,6 +766,7 @@ Obtains the text of the current event. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -800,6 +809,7 @@ Checks whether the current element is empty. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -842,6 +852,7 @@ Checks whether the current text event contains only whitespace characters. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' + @@ -883,6 +894,7 @@ Obtains the number of attributes for the current start tag. **Example** ```js +import util from '@ohos.util'; let strXml = '' + '' +