From a6c9762ce2e1028b02518fa0a74692c6a40d222c Mon Sep 17 00:00:00 2001 From: wangyong1995626wywz Date: Wed, 11 May 2022 09:18:40 +0800 Subject: [PATCH] Solve the problem of console Log error Description In the new IDE, console The first element of log output must be of character type #I56TL2:Solve the problem of console Log error Signed-off-by: wangyong1995626wywz --- .../reference/apis/js-apis-arraylist.md | 12 +++++------ .../reference/apis/js-apis-deque.md | 8 ++++---- .../reference/apis/js-apis-hashmap.md | 20 +++++++++---------- .../reference/apis/js-apis-hashset.md | 10 +++++----- .../reference/apis/js-apis-lightweightmap.md | 20 +++++++++---------- .../reference/apis/js-apis-lightweightset.md | 8 ++++---- .../reference/apis/js-apis-linkedlist.md | 8 ++++---- .../reference/apis/js-apis-list.md | 12 +++++------ .../reference/apis/js-apis-plainarray.md | 14 ++++++------- .../reference/apis/js-apis-queue.md | 8 ++++---- .../reference/apis/js-apis-stack.md | 8 ++++---- .../reference/apis/js-apis-treemap.md | 20 +++++++++---------- .../reference/apis/js-apis-treeset.md | 14 ++++++------- .../reference/apis/js-apis-vector.md | 12 +++++------ 14 files changed, 87 insertions(+), 87 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-arraylist.md b/zh-cn/application-dev/reference/apis/js-apis-arraylist.md index 6b0b5e5725..2e18337e12 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-arraylist.md +++ b/zh-cn/application-dev/reference/apis/js-apis-arraylist.md @@ -6,7 +6,7 @@ ## 导入模块 ```ts -import ArrayList from '@ohos.util.ArrayList' +import ArrayList from '@ohos.util.ArrayList'; ``` ## 系统能力 @@ -332,7 +332,7 @@ arrayList.add(4); arrayList.add(5); arrayList.add(4); arrayList.forEach((value, index) => { - console.log(value, index); + console.log("value:" + value, index); }); ``` @@ -363,8 +363,8 @@ arrayList.add(2); arrayList.add(4); arrayList.add(5); arrayList.add(4); -arrayList.sort(a, (b => a - b)); -arrayList.sort(a, (b => b - a)); +arrayList.sort((a, b) => a - b); +arrayList.sort((a, b) => b - a); arrayList.sort(); ``` @@ -574,14 +574,14 @@ arrayList.add(4); // 使用方法一: for (let item of arrayList) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = arrayList[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-deque.md b/zh-cn/application-dev/reference/apis/js-apis-deque.md index 724c8ec6cc..1ad1b76474 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deque.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deque.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import Deque from '@ohos.util.Deque' +import Deque from '@ohos.util.Deque'; ``` ## 系统能力 @@ -188,7 +188,7 @@ deque.insertEnd(4); deque.insertFront(5); deque.insertEnd(4); deque.forEach((value, index) => { - console.log(value, index); + console.log("value:" + value, index); }); ``` @@ -261,14 +261,14 @@ deque.insertFront(4); // 使用方法一: for (let item of deque) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = deque[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-hashmap.md b/zh-cn/application-dev/reference/apis/js-apis-hashmap.md index 6c7a0d6d94..cfb107c2fc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hashmap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hashmap.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import HashMap from '@ohos.util.HashMap' +import HashMap from '@ohos.util.HashMap'; ``` ## 系统能力 @@ -256,7 +256,7 @@ hashMap.set("sdfs", 356); let iter = hashMap.keys(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -283,7 +283,7 @@ hashMap.set("sdfs", 356); let iter = hashMap.values(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -344,7 +344,7 @@ let hashMap = new HashMap(); hashMap.set("sdfs", 123); hashMap.set("dfsghsf", 357); hashMap.forEach((value, key) => { - console.log(value, key); + console.log("value:" + value, key); }); ``` @@ -370,8 +370,8 @@ hashMap.set("sdfs", 356); let iter = hashMap.entries(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` @@ -397,16 +397,16 @@ hashMap.set("sdfs", 356); // 使用方法一: for (let item of hashMap) { - console.log("key: " + item[0]); - console.log("value: " + item[1]); + console.log("key:" + item[0]); + console.log("value:" + item[1]); } // 使用方法二: let iter = hashMap[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-hashset.md b/zh-cn/application-dev/reference/apis/js-apis-hashset.md index 10023c1ac5..29d056156d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hashset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hashset.md @@ -176,7 +176,7 @@ hashSet.add("sdfs"); let iter = hashSet.values(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -209,7 +209,7 @@ let hashSet = new HashSet(); hashSet.add("sdfs"); hashSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf"); hashSet.forEach((value, key) => { - console.log(value, key); + console.log("value:" + value, key); }); ``` @@ -234,8 +234,8 @@ hashSet.add("sdfs"); let iter = hashSet.entries(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` @@ -269,7 +269,7 @@ for (let item of hashSet) { let iter = hashSet[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value: " + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md index f639a9ed5b..aa960436b5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import LightWeightMap from '@ohos.util.LightWeightMap' +import LightWeightMap from '@ohos.util.LightWeightMap'; ``` ## 系统能力 @@ -475,7 +475,7 @@ lightWeightMap.set("sdfs", 356); let iter = lightWeightMap.keys(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -502,7 +502,7 @@ lightWeightMap.set("sdfs", 356); let iter = lightWeightMap.values(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -535,7 +535,7 @@ let lightWeightMap = new LightWeightMap(); lightWeightMap.set("sdfs", 123); lightWeightMap.set("dfsghsf", 357); lightWeightMap.forEach((value, key) => { - console.log(value, key); + console.log("value:" + value, key); }); ``` @@ -561,8 +561,8 @@ lightWeightMap.set("sdfs", 356); let iter = lightWeightMap.entries(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` @@ -609,16 +609,16 @@ lightWeightMap.set("sdfs", 356); // 使用方法一: for (let item of lightWeightMap) { - console.log("key: " + item[0]); - console.log("value: " + item[1]); + console.log("key:" + item[0]); + console.log("value:" + item[1]); } // 使用方法二: let iter = lightWeightMap[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md b/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md index 9cb7ec6a0d..99d37c6bcb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import LightWeightSet from '@ohos.util.LightWeightSet' +import LightWeightSet from '@ohos.util.LightWeightSet'; ``` ## 系统能力 @@ -439,7 +439,7 @@ let lightWeightSet = new LightWeightSet(); lightWeightSet.add("sdfs"); lightWeightSet.add("dfsghsf"); lightWeightSet.forEach((value, key) => { - console.log(value, key); + console.log("value:" + value, key); }); ``` @@ -492,14 +492,14 @@ lightWeightSet.add("sdfs"); // 使用方法一: for (let item of lightWeightSet) { - console.log("value: " + item); + console.log("value:" + item); } // 使用方法二: let iter = lightWeightSet[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md index e4370ee75c..b6be34281a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md +++ b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import LinkedList from '@ohos.util.LinkedList' +import LinkedList from '@ohos.util.LinkedList'; ``` ## 系统能力 @@ -457,7 +457,7 @@ linkedList.add(4); linkedList.add(5); linkedList.add(4); linkedList.forEach((value, index) => { - console.log(value, index); + console.log("value:" + value, index); }); ``` @@ -600,14 +600,14 @@ linkedList.add(4); // 使用方法一: for (let item of linkedList) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = linkedList[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-list.md b/zh-cn/application-dev/reference/apis/js-apis-list.md index 5eb877e343..72ded21388 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-list.md +++ b/zh-cn/application-dev/reference/apis/js-apis-list.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import List from '@ohos.util.List' +import List from '@ohos.util.List'; ``` ## 系统能力 @@ -378,7 +378,7 @@ list.add(4); list.add(5); list.add(4); list.forEach((value, index) => { - console.log(value, index); + console.log("value: " + value, index); }); ``` @@ -410,8 +410,8 @@ list.add(2); list.add(4); list.add(5); list.add(4); -list.sort(a, (b => a - b)); -list.sort(a, (b => b - a)); +list.sort((a, b) => a - b); +list.sort((a, b) => b - a); ``` ### getSubList @@ -610,14 +610,14 @@ list.add(4); // 使用方法一: for (let item of list) { - console.log(item); + console.log("value: " + item); } // 使用方法二: let iter = list[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value: " + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-plainarray.md b/zh-cn/application-dev/reference/apis/js-apis-plainarray.md index 832956e528..353c68b0bd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-plainarray.md +++ b/zh-cn/application-dev/reference/apis/js-apis-plainarray.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import PlainArray from '@ohos.util.PlainArray' +import PlainArray from '@ohos.util.PlainArray'; ``` ## 系统能力 @@ -440,8 +440,8 @@ callbackfn的参数说明: let plainArray = new PlainArray(); plainArray.add(1, "sddfhf"); plainArray.add(2, "sffdfhf"); -plainArray.forEach((value, key) => { - console.log(value, key); +plainArray.forEach((value, index) => { + console.log("value:" + value, index); }); ``` @@ -467,16 +467,16 @@ plainArray.add(2, "sffdfhf"); // 使用方法一: for (let item of plainArray) { - console.log("index: " + item[0]); - console.log("value: " + item[1]); + console.log("index:" + item[0]); + console.log("value:" + item[1]); } // 使用方法二: let iter = plainArray[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("index:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-queue.md b/zh-cn/application-dev/reference/apis/js-apis-queue.md index a617929286..86edd7a79e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-queue.md +++ b/zh-cn/application-dev/reference/apis/js-apis-queue.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import Queue from '@ohos.util.Queue' +import Queue from '@ohos.util.Queue'; ``` ## 系统能力 @@ -147,7 +147,7 @@ queue.add(4); queue.add(5); queue.add(4); queue.forEach((value, index) => { - console.log(value, index); + console.log("value:" + value, index); }); ``` @@ -175,14 +175,14 @@ queue.add(4); // 使用方法一: for (let item of queue) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = queue[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-stack.md b/zh-cn/application-dev/reference/apis/js-apis-stack.md index ff5fd3f8bd..de2efb76dd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-stack.md +++ b/zh-cn/application-dev/reference/apis/js-apis-stack.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import Stack from '@ohos.util.Stack' +import Stack from '@ohos.util.Stack'; ``` ## 系统能力 @@ -175,7 +175,7 @@ stack.push(4); stack.push(5); stack.push(4); stack.forEach((value, index) => { - console.log(value, index); + console.log("value:" + value, index); }); ``` @@ -225,14 +225,14 @@ stack.push(4); // 使用方法一: for (let item of stack) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = stack[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-treemap.md b/zh-cn/application-dev/reference/apis/js-apis-treemap.md index 8646af2ff7..4ca6d30d62 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-treemap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-treemap.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import TreeMap from '@ohos.util.TreeMap' +import TreeMap from '@ohos.util.TreeMap'; ``` ## 系统能力 @@ -391,7 +391,7 @@ treeMap.set("sdfs", 356); let iter = treeMap.keys(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -418,7 +418,7 @@ treeMap.set("sdfs", 356); let iter = treeMap.values(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -451,7 +451,7 @@ let treeMap = new TreeMap(); treeMap.set("sdfs", 123); treeMap.set("dfsghsf", 357); treeMap.forEach((value, key) => { - console.log(value, key); + console.log("value:" + value, key); }); ``` @@ -477,8 +477,8 @@ treeMap.set("sdfs", 356); let iter = treeMap.entries(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` @@ -505,16 +505,16 @@ treeMap.set("sdfs", 356); // 使用方法一: for (let item of treeMap) { - console.log("key: " + item[0]); - console.log("value: " + item[1]); + console.log("key:" + item[0]); + console.log("value:" + item[1]); } // 使用方法二: let iter = treeMap[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-treeset.md b/zh-cn/application-dev/reference/apis/js-apis-treeset.md index 6caf182b3c..9c0fc52705 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-treeset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-treeset.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import TreeSet from '@ohos.util.TreeSet' +import TreeSet from '@ohos.util.TreeSet'; ``` ## 系统能力 @@ -328,7 +328,7 @@ treeSet.add("sdfs"); let iter = treeSet.values(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` @@ -361,7 +361,7 @@ let treeSet = new TreeSet(); treeSet.add("sdfs"); treeSet.add("dfsghsf"); treeSet.forEach((value, key) => { - console.log(value, key) + console.log("value:" + value, key) }); ``` @@ -387,8 +387,8 @@ treeSet.add("sdfs"); let iter = treeSet.entries(); let temp = iter.next().value; while(temp != undefined) { - console.log(temp[0]); - console.log(temp[1]); + console.log("key:" + temp[0]); + console.log("value:" + temp[1]); temp = iter.next().value; } ``` @@ -416,14 +416,14 @@ treeSet.add("sdfs"); // 使用方法一: for (let item of treeSet) { - console.log("value: " + item); + console.log("value:" + item); } // 使用方法二: let iter = treeSet[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-vector.md b/zh-cn/application-dev/reference/apis/js-apis-vector.md index fa7fd3018e..193b8576b6 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-vector.md +++ b/zh-cn/application-dev/reference/apis/js-apis-vector.md @@ -7,7 +7,7 @@ ## 导入模块 ```ts -import Vector from '@ohos.util.Vector' +import Vector from '@ohos.util.Vector'; ``` ## 系统能力 @@ -335,7 +335,7 @@ vector.add(4); vector.add(5); vector.add(4); vector.forEach((value, index) => { - console.log(value, index) + console.log("value:" + value, index) }); ``` @@ -367,8 +367,8 @@ vector.add(2); vector.add(4); vector.add(5); vector.add(4); -vector.sort(a, (b => a - b)); -vector.sort(a, (b => b - a)); +vector.sort((a, b) => a - b); +vector.sort((a, b) => b - a); vector.sort(); ``` @@ -815,14 +815,14 @@ vector.add(4); // 使用方法一: for (let item of vector) { - console.log(item); + console.log("value:" + item); } // 使用方法二: let iter = vector[Symbol.iterator](); let temp = iter.next().value; while(temp != undefined) { - console.log(temp); + console.log("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file -- GitLab