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

!3901 Solve the problem of console Log error

Merge pull request !3901 from wangyong/release_three
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import ArrayList from '@ohos.util.ArrayList' import ArrayList from '@ohos.util.ArrayList';
``` ```
## 系统能力 ## 系统能力
...@@ -332,7 +332,7 @@ arrayList.add(4); ...@@ -332,7 +332,7 @@ arrayList.add(4);
arrayList.add(5); arrayList.add(5);
arrayList.add(4); arrayList.add(4);
arrayList.forEach((value, index) => { arrayList.forEach((value, index) => {
console.log(value, index); console.log("value:" + value, index);
}); });
``` ```
...@@ -363,8 +363,8 @@ arrayList.add(2); ...@@ -363,8 +363,8 @@ arrayList.add(2);
arrayList.add(4); arrayList.add(4);
arrayList.add(5); arrayList.add(5);
arrayList.add(4); arrayList.add(4);
arrayList.sort(a, (b => a - b)); arrayList.sort((a, b) => a - b);
arrayList.sort(a, (b => b - a)); arrayList.sort((a, b) => b - a);
arrayList.sort(); arrayList.sort();
``` ```
...@@ -574,14 +574,14 @@ arrayList.add(4); ...@@ -574,14 +574,14 @@ arrayList.add(4);
// 使用方法一: // 使用方法一:
for (let item of arrayList) { for (let item of arrayList) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = arrayList[Symbol.iterator](); let iter = arrayList[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import Deque from '@ohos.util.Deque' import Deque from '@ohos.util.Deque';
``` ```
## 系统能力 ## 系统能力
...@@ -188,7 +188,7 @@ deque.insertEnd(4); ...@@ -188,7 +188,7 @@ deque.insertEnd(4);
deque.insertFront(5); deque.insertFront(5);
deque.insertEnd(4); deque.insertEnd(4);
deque.forEach((value, index) => { deque.forEach((value, index) => {
console.log(value, index); console.log("value:" + value, index);
}); });
``` ```
...@@ -261,14 +261,14 @@ deque.insertFront(4); ...@@ -261,14 +261,14 @@ deque.insertFront(4);
// 使用方法一: // 使用方法一:
for (let item of deque) { for (let item of deque) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = deque[Symbol.iterator](); let iter = deque[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import HashMap from '@ohos.util.HashMap' import HashMap from '@ohos.util.HashMap';
``` ```
## 系统能力 ## 系统能力
...@@ -256,7 +256,7 @@ hashMap.set("sdfs", 356); ...@@ -256,7 +256,7 @@ hashMap.set("sdfs", 356);
let iter = hashMap.keys(); let iter = hashMap.keys();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -283,7 +283,7 @@ hashMap.set("sdfs", 356); ...@@ -283,7 +283,7 @@ hashMap.set("sdfs", 356);
let iter = hashMap.values(); let iter = hashMap.values();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -344,7 +344,7 @@ let hashMap = new HashMap(); ...@@ -344,7 +344,7 @@ let hashMap = new HashMap();
hashMap.set("sdfs", 123); hashMap.set("sdfs", 123);
hashMap.set("dfsghsf", 357); hashMap.set("dfsghsf", 357);
hashMap.forEach((value, key) => { hashMap.forEach((value, key) => {
console.log(value, key); console.log("value:" + value, key);
}); });
``` ```
...@@ -370,8 +370,8 @@ hashMap.set("sdfs", 356); ...@@ -370,8 +370,8 @@ hashMap.set("sdfs", 356);
let iter = hashMap.entries(); let iter = hashMap.entries();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -397,16 +397,16 @@ hashMap.set("sdfs", 356); ...@@ -397,16 +397,16 @@ hashMap.set("sdfs", 356);
// 使用方法一: // 使用方法一:
for (let item of hashMap) { for (let item of hashMap) {
console.log("key: " + item[0]); console.log("key:" + item[0]);
console.log("value: " + item[1]); console.log("value:" + item[1]);
} }
// 使用方法二: // 使用方法二:
let iter = hashMap[Symbol.iterator](); let iter = hashMap[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -176,7 +176,7 @@ hashSet.add("sdfs"); ...@@ -176,7 +176,7 @@ hashSet.add("sdfs");
let iter = hashSet.values(); let iter = hashSet.values();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -209,7 +209,7 @@ let hashSet = new HashSet(); ...@@ -209,7 +209,7 @@ let hashSet = new HashSet();
hashSet.add("sdfs"); hashSet.add("sdfs");
hashSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf"); hashSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf");
hashSet.forEach((value, key) => { hashSet.forEach((value, key) => {
console.log(value, key); console.log("value:" + value, key);
}); });
``` ```
...@@ -234,8 +234,8 @@ hashSet.add("sdfs"); ...@@ -234,8 +234,8 @@ hashSet.add("sdfs");
let iter = hashSet.entries(); let iter = hashSet.entries();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -269,7 +269,7 @@ for (let item of hashSet) { ...@@ -269,7 +269,7 @@ for (let item of hashSet) {
let iter = hashSet[Symbol.iterator](); let iter = hashSet[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value: " + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import LightWeightMap from '@ohos.util.LightWeightMap' import LightWeightMap from '@ohos.util.LightWeightMap';
``` ```
## 系统能力 ## 系统能力
...@@ -475,7 +475,7 @@ lightWeightMap.set("sdfs", 356); ...@@ -475,7 +475,7 @@ lightWeightMap.set("sdfs", 356);
let iter = lightWeightMap.keys(); let iter = lightWeightMap.keys();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -502,7 +502,7 @@ lightWeightMap.set("sdfs", 356); ...@@ -502,7 +502,7 @@ lightWeightMap.set("sdfs", 356);
let iter = lightWeightMap.values(); let iter = lightWeightMap.values();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -535,7 +535,7 @@ let lightWeightMap = new LightWeightMap(); ...@@ -535,7 +535,7 @@ let lightWeightMap = new LightWeightMap();
lightWeightMap.set("sdfs", 123); lightWeightMap.set("sdfs", 123);
lightWeightMap.set("dfsghsf", 357); lightWeightMap.set("dfsghsf", 357);
lightWeightMap.forEach((value, key) => { lightWeightMap.forEach((value, key) => {
console.log(value, key); console.log("value:" + value, key);
}); });
``` ```
...@@ -561,8 +561,8 @@ lightWeightMap.set("sdfs", 356); ...@@ -561,8 +561,8 @@ lightWeightMap.set("sdfs", 356);
let iter = lightWeightMap.entries(); let iter = lightWeightMap.entries();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -609,16 +609,16 @@ lightWeightMap.set("sdfs", 356); ...@@ -609,16 +609,16 @@ lightWeightMap.set("sdfs", 356);
// 使用方法一: // 使用方法一:
for (let item of lightWeightMap) { for (let item of lightWeightMap) {
console.log("key: " + item[0]); console.log("key:" + item[0]);
console.log("value: " + item[1]); console.log("value:" + item[1]);
} }
// 使用方法二: // 使用方法二:
let iter = lightWeightMap[Symbol.iterator](); let iter = lightWeightMap[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import LightWeightSet from '@ohos.util.LightWeightSet' import LightWeightSet from '@ohos.util.LightWeightSet';
``` ```
## 系统能力 ## 系统能力
...@@ -439,7 +439,7 @@ let lightWeightSet = new LightWeightSet(); ...@@ -439,7 +439,7 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("sdfs"); lightWeightSet.add("sdfs");
lightWeightSet.add("dfsghsf"); lightWeightSet.add("dfsghsf");
lightWeightSet.forEach((value, key) => { lightWeightSet.forEach((value, key) => {
console.log(value, key); console.log("value:" + value, key);
}); });
``` ```
...@@ -492,14 +492,14 @@ lightWeightSet.add("sdfs"); ...@@ -492,14 +492,14 @@ lightWeightSet.add("sdfs");
// 使用方法一: // 使用方法一:
for (let item of lightWeightSet) { for (let item of lightWeightSet) {
console.log("value: " + item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = lightWeightSet[Symbol.iterator](); let iter = lightWeightSet[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import LinkedList from '@ohos.util.LinkedList' import LinkedList from '@ohos.util.LinkedList';
``` ```
## 系统能力 ## 系统能力
...@@ -457,7 +457,7 @@ linkedList.add(4); ...@@ -457,7 +457,7 @@ linkedList.add(4);
linkedList.add(5); linkedList.add(5);
linkedList.add(4); linkedList.add(4);
linkedList.forEach((value, index) => { linkedList.forEach((value, index) => {
console.log(value, index); console.log("value:" + value, index);
}); });
``` ```
...@@ -600,14 +600,14 @@ linkedList.add(4); ...@@ -600,14 +600,14 @@ linkedList.add(4);
// 使用方法一: // 使用方法一:
for (let item of linkedList) { for (let item of linkedList) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = linkedList[Symbol.iterator](); let iter = linkedList[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import List from '@ohos.util.List' import List from '@ohos.util.List';
``` ```
## 系统能力 ## 系统能力
...@@ -378,7 +378,7 @@ list.add(4); ...@@ -378,7 +378,7 @@ list.add(4);
list.add(5); list.add(5);
list.add(4); list.add(4);
list.forEach((value, index) => { list.forEach((value, index) => {
console.log(value, index); console.log("value: " + value, index);
}); });
``` ```
...@@ -410,8 +410,8 @@ list.add(2); ...@@ -410,8 +410,8 @@ list.add(2);
list.add(4); list.add(4);
list.add(5); list.add(5);
list.add(4); list.add(4);
list.sort(a, (b => a - b)); list.sort((a, b) => a - b);
list.sort(a, (b => b - a)); list.sort((a, b) => b - a);
``` ```
### getSubList ### getSubList
...@@ -610,14 +610,14 @@ list.add(4); ...@@ -610,14 +610,14 @@ list.add(4);
// 使用方法一: // 使用方法一:
for (let item of list) { for (let item of list) {
console.log(item); console.log("value: " + item);
} }
// 使用方法二: // 使用方法二:
let iter = list[Symbol.iterator](); let iter = list[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value: " + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import PlainArray from '@ohos.util.PlainArray' import PlainArray from '@ohos.util.PlainArray';
``` ```
## 系统能力 ## 系统能力
...@@ -440,8 +440,8 @@ callbackfn的参数说明: ...@@ -440,8 +440,8 @@ callbackfn的参数说明:
let plainArray = new PlainArray(); let plainArray = new PlainArray();
plainArray.add(1, "sddfhf"); plainArray.add(1, "sddfhf");
plainArray.add(2, "sffdfhf"); plainArray.add(2, "sffdfhf");
plainArray.forEach((value, key) => { plainArray.forEach((value, index) => {
console.log(value, key); console.log("value:" + value, index);
}); });
``` ```
...@@ -467,16 +467,16 @@ plainArray.add(2, "sffdfhf"); ...@@ -467,16 +467,16 @@ plainArray.add(2, "sffdfhf");
// 使用方法一: // 使用方法一:
for (let item of plainArray) { for (let item of plainArray) {
console.log("index: " + item[0]); console.log("index:" + item[0]);
console.log("value: " + item[1]); console.log("value:" + item[1]);
} }
// 使用方法二: // 使用方法二:
let iter = plainArray[Symbol.iterator](); let iter = plainArray[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("index:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import Queue from '@ohos.util.Queue' import Queue from '@ohos.util.Queue';
``` ```
## 系统能力 ## 系统能力
...@@ -147,7 +147,7 @@ queue.add(4); ...@@ -147,7 +147,7 @@ queue.add(4);
queue.add(5); queue.add(5);
queue.add(4); queue.add(4);
queue.forEach((value, index) => { queue.forEach((value, index) => {
console.log(value, index); console.log("value:" + value, index);
}); });
``` ```
...@@ -175,14 +175,14 @@ queue.add(4); ...@@ -175,14 +175,14 @@ queue.add(4);
// 使用方法一: // 使用方法一:
for (let item of queue) { for (let item of queue) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = queue[Symbol.iterator](); let iter = queue[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import Stack from '@ohos.util.Stack' import Stack from '@ohos.util.Stack';
``` ```
## 系统能力 ## 系统能力
...@@ -175,7 +175,7 @@ stack.push(4); ...@@ -175,7 +175,7 @@ stack.push(4);
stack.push(5); stack.push(5);
stack.push(4); stack.push(4);
stack.forEach((value, index) => { stack.forEach((value, index) => {
console.log(value, index); console.log("value:" + value, index);
}); });
``` ```
...@@ -225,14 +225,14 @@ stack.push(4); ...@@ -225,14 +225,14 @@ stack.push(4);
// 使用方法一: // 使用方法一:
for (let item of stack) { for (let item of stack) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = stack[Symbol.iterator](); let iter = stack[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import TreeMap from '@ohos.util.TreeMap' import TreeMap from '@ohos.util.TreeMap';
``` ```
## 系统能力 ## 系统能力
...@@ -391,7 +391,7 @@ treeMap.set("sdfs", 356); ...@@ -391,7 +391,7 @@ treeMap.set("sdfs", 356);
let iter = treeMap.keys(); let iter = treeMap.keys();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -418,7 +418,7 @@ treeMap.set("sdfs", 356); ...@@ -418,7 +418,7 @@ treeMap.set("sdfs", 356);
let iter = treeMap.values(); let iter = treeMap.values();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -451,7 +451,7 @@ let treeMap = new TreeMap(); ...@@ -451,7 +451,7 @@ let treeMap = new TreeMap();
treeMap.set("sdfs", 123); treeMap.set("sdfs", 123);
treeMap.set("dfsghsf", 357); treeMap.set("dfsghsf", 357);
treeMap.forEach((value, key) => { treeMap.forEach((value, key) => {
console.log(value, key); console.log("value:" + value, key);
}); });
``` ```
...@@ -477,8 +477,8 @@ treeMap.set("sdfs", 356); ...@@ -477,8 +477,8 @@ treeMap.set("sdfs", 356);
let iter = treeMap.entries(); let iter = treeMap.entries();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -505,16 +505,16 @@ treeMap.set("sdfs", 356); ...@@ -505,16 +505,16 @@ treeMap.set("sdfs", 356);
// 使用方法一: // 使用方法一:
for (let item of treeMap) { for (let item of treeMap) {
console.log("key: " + item[0]); console.log("key:" + item[0]);
console.log("value: " + item[1]); console.log("value:" + item[1]);
} }
// 使用方法二: // 使用方法二:
let iter = treeMap[Symbol.iterator](); let iter = treeMap[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import TreeSet from '@ohos.util.TreeSet' import TreeSet from '@ohos.util.TreeSet';
``` ```
## 系统能力 ## 系统能力
...@@ -328,7 +328,7 @@ treeSet.add("sdfs"); ...@@ -328,7 +328,7 @@ treeSet.add("sdfs");
let iter = treeSet.values(); let iter = treeSet.values();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -361,7 +361,7 @@ let treeSet = new TreeSet(); ...@@ -361,7 +361,7 @@ let treeSet = new TreeSet();
treeSet.add("sdfs"); treeSet.add("sdfs");
treeSet.add("dfsghsf"); treeSet.add("dfsghsf");
treeSet.forEach((value, key) => { treeSet.forEach((value, key) => {
console.log(value, key) console.log("value:" + value, key)
}); });
``` ```
...@@ -387,8 +387,8 @@ treeSet.add("sdfs"); ...@@ -387,8 +387,8 @@ treeSet.add("sdfs");
let iter = treeSet.entries(); let iter = treeSet.entries();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp[0]); console.log("key:" + temp[0]);
console.log(temp[1]); console.log("value:" + temp[1]);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
...@@ -416,14 +416,14 @@ treeSet.add("sdfs"); ...@@ -416,14 +416,14 @@ treeSet.add("sdfs");
// 使用方法一: // 使用方法一:
for (let item of treeSet) { for (let item of treeSet) {
console.log("value: " + item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = treeSet[Symbol.iterator](); let iter = treeSet[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```ts ```ts
import Vector from '@ohos.util.Vector' import Vector from '@ohos.util.Vector';
``` ```
## 系统能力 ## 系统能力
...@@ -335,7 +335,7 @@ vector.add(4); ...@@ -335,7 +335,7 @@ vector.add(4);
vector.add(5); vector.add(5);
vector.add(4); vector.add(4);
vector.forEach((value, index) => { vector.forEach((value, index) => {
console.log(value, index) console.log("value:" + value, index)
}); });
``` ```
...@@ -367,8 +367,8 @@ vector.add(2); ...@@ -367,8 +367,8 @@ vector.add(2);
vector.add(4); vector.add(4);
vector.add(5); vector.add(5);
vector.add(4); vector.add(4);
vector.sort(a, (b => a - b)); vector.sort((a, b) => a - b);
vector.sort(a, (b => b - a)); vector.sort((a, b) => b - a);
vector.sort(); vector.sort();
``` ```
...@@ -815,14 +815,14 @@ vector.add(4); ...@@ -815,14 +815,14 @@ vector.add(4);
// 使用方法一: // 使用方法一:
for (let item of vector) { for (let item of vector) {
console.log(item); console.log("value:" + item);
} }
// 使用方法二: // 使用方法二:
let iter = vector[Symbol.iterator](); let iter = vector[Symbol.iterator]();
let temp = iter.next().value; let temp = iter.next().value;
while(temp != undefined) { while(temp != undefined) {
console.log(temp); console.log("value:" + temp);
temp = iter.next().value; temp = iter.next().value;
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册