未验证 提交 04195efb 编写于 作者: O openharmony_ci 提交者: Gitee

!2768 Done! 2398:Modify partial container construction missing parentheses

Merge pull request !2768 from wusongqing/TR2398
...@@ -49,7 +49,7 @@ Inserts an entry at the front of this container. ...@@ -49,7 +49,7 @@ Inserts an entry at the front of this container.
**Example** **Example**
``` ```
let deque = new Deque; let deque = new Deque();
deque.insertFront("a"); deque.insertFront("a");
deque.insertFront(1); deque.insertFront(1);
let b = [1, 2, 3]; let b = [1, 2, 3];
...@@ -73,7 +73,7 @@ Inserts an entry at the end of this container. ...@@ -73,7 +73,7 @@ Inserts an entry at the end of this container.
**Example** **Example**
``` ```
let deque = new Deque; let deque = new Deque();
deque.insertEnd("a"); deque.insertEnd("a");
deque.insertEnd(1); deque.insertEnd(1);
let b = [1, 2, 3]; let b = [1, 2, 3];
......
...@@ -176,7 +176,7 @@ let result = linkedList.get(2); ...@@ -176,7 +176,7 @@ let result = linkedList.get(2);
### getLastIndexOf ### getLastIndexOf
getLastIndexOf(element: T): number; getLastIndexOf(element: T): number
Obtains the index of the last occurrence of the specified entry in this container. Obtains the index of the last occurrence of the specified entry in this container.
...@@ -404,11 +404,10 @@ let result = linkedList.removeLastFound(4); ...@@ -404,11 +404,10 @@ let result = linkedList.removeLastFound(4);
``` ```
### clone ### clone
clone(): LinkedList<T>
Clones this container and returns a copy. clone(): LinkedList<T>
The modification to the copy does not affect the original instance. Clones this container and returns a copy. The modification to the copy does not affect the original instance.
**Return value** **Return value**
...@@ -428,6 +427,7 @@ let result = linkedList.clone(); ...@@ -428,6 +427,7 @@ let result = linkedList.clone();
``` ```
### forEach ### forEach
forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList<T>) => void, forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList<T>) => void,
thisArg?: Object): void thisArg?: Object): void
...@@ -462,6 +462,7 @@ linkedList.forEach((value, index) => { ...@@ -462,6 +462,7 @@ linkedList.forEach((value, index) => {
``` ```
### clear ### clear
clear(): void clear(): void
Clears this container and sets its length to **0**. Clears this container and sets its length to **0**.
...@@ -478,6 +479,7 @@ linkedList.clear(); ...@@ -478,6 +479,7 @@ linkedList.clear();
``` ```
### set ### set
set(index: number, element: T): T set(index: number, element: T): T
Replaces an entry at the specified position in this container with a given entry. Replaces an entry at the specified position in this container with a given entry.
...@@ -507,6 +509,7 @@ let result = linkedList.set(2, "b"); ...@@ -507,6 +509,7 @@ let result = linkedList.set(2, "b");
``` ```
### convertToArray ### convertToArray
convertToArray(): Array<T> convertToArray(): Array<T>
Converts this container into an array. Converts this container into an array.
...@@ -575,7 +578,7 @@ linkedList.getLast(); ...@@ -575,7 +578,7 @@ linkedList.getLast();
### [Symbol.iterator] ### [Symbol.iterator]
[Symbol.iterator]\(): IterableIterator<T>; [Symbol.iterator]\(): IterableIterator<T>
Obtains an iterator, each item of which is a JavaScript object. Obtains an iterator, each item of which is a JavaScript object.
......
...@@ -528,6 +528,7 @@ vector.increaseCapacityTo(8); ...@@ -528,6 +528,7 @@ vector.increaseCapacityTo(8);
``` ```
### trimToCurrentLength ### trimToCurrentLength
trimToCurrentLength(): void trimToCurrentLength(): void
Trims the capacity of this container into its current length. Trims the capacity of this container into its current length.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册