diff --git a/zh-cn/application-dev/arkts-utils/transferabled-object.md b/zh-cn/application-dev/arkts-utils/transferabled-object.md index 49ae9d4fd38c034dfc7000a473c2f4c1b7fa94e7..58949dab595d5fb18ff08ff4c44fc805eb902a98 100644 --- a/zh-cn/application-dev/arkts-utils/transferabled-object.md +++ b/zh-cn/application-dev/arkts-utils/transferabled-object.md @@ -49,7 +49,7 @@ struct Index { taskpool.execute(loadPixelMap, rawFileDescriptor).then(pixelMap => { if (pixelMap) { this.pixelMap = pixelMap as PixelMap; - console.log('Succeeded in creating pixelMap.'); + console.info('Succeeded in creating pixelMap.'); // 主线程释放pixelMap。由于子线程返回pixelMap时已调用setTransferDetached,所以此处能够立即释放pixelMap。 this.pixelMap.release(); } else { diff --git a/zh-cn/application-dev/arkts-utils/worker-and-taskpool.md b/zh-cn/application-dev/arkts-utils/worker-and-taskpool.md index 66bfac3c7fa69945f98ced3d20ffb534accb3045..d0e107fb809371b572cdbd73c954b14f0c3b25f5 100644 --- a/zh-cn/application-dev/arkts-utils/worker-and-taskpool.md +++ b/zh-cn/application-dev/arkts-utils/worker-and-taskpool.md @@ -31,7 +31,7 @@ ArkTS应用开发过程中,可以选择TaskPool或Worker线程进行多任务 // 2. 接收Worker返回的结果 myWorker.onmessage = (e) => { - console.log('主线程收到最终结果:', e.data.result); + console.info('主线程收到最终结果:', e.data.result); myWorker.terminate(); // 销毁Worker }; @@ -61,7 +61,7 @@ ArkTS应用开发过程中,可以选择TaskPool或Worker线程进行多任务 // 调用TaskPool执行并发任务 const task = new taskpool.Task(parallelTask, processedData); const result = await taskpool.execute(task); - console.log('Worker线程返回结果: ', result); + console.info('Worker线程返回结果: ', result); // 将最终结果返回主线程 workerPort.postMessage({ @@ -85,7 +85,7 @@ ArkTS应用开发过程中,可以选择TaskPool或Worker线程进行多任务 for (let i = 0; i < base; i++) { total += i % 2 === 0 ? i : -i; } - console.log('TaskPool线程计算结果: ', total); + console.info('TaskPool线程计算结果: ', total); return total; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-arraylist.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-arraylist.md index d28b26fb0570f0a6c3f42fa19f045294c112606f..88170ffa97d853a768d83514c4e7702eb6b7b15c 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-arraylist.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-arraylist.md @@ -485,7 +485,7 @@ arrayList.add(4); arrayList.add(5); arrayList.add(4); arrayList.forEach((value: number, index?: number) => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -892,14 +892,14 @@ arrayList.add(4); // 使用方法一: let numbers: Array = arrayList.convertToArray(); for (let item of numbers) { - console.log(`value : ${item}`); + console.info(`value : ${item}`); } // 使用方法二: let iter = arrayList[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log(`value:${temp.value}`); + console.info(`value:${temp.value}`); temp = iter.next(); } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-convertxml.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-convertxml.md index 5a8941ef53d408e4ee45468b6e6c506771ebaee3..000efe3fd7773046eb02f5788ec76abf04382cd3 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-convertxml.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-convertxml.md @@ -70,9 +70,9 @@ try { nameKey: "_name", elementsKey: "_elements" } let result = JSON.stringify(conv.fastConvertToJSObject(xml, options)); - console.log(result); + console.info(result); } catch (e) { - console.log((e as Object).toString()); + console.error((e as Object).toString()); } // 输出(宽泛型) // {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Hello\nWorld"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"cdata","_cdata":"Work\n"}]}]}]} @@ -134,9 +134,9 @@ try { nameKey: "_name", elementsKey: "_elements" } let result = JSON.stringify(conv.convertToJSObject(xml, options)); - console.log(result); + console.info(result); } catch (e) { - console.log((e as Object).toString()); + console.error((e as Object).toString()); } // 输出(宽泛型) // {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Happy"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Work"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Play"}]}]}]} @@ -184,7 +184,7 @@ let options: convertxml.ConvertOptions = {trim : false, declarationKey:"_declara commentKey : "_comment", parentKey : "_parent", typeKey : "_type", nameKey : "_name", elementsKey : "_elements"} let result = JSON.stringify(conv.convert(xml, options)); -console.log(result); +console.info(result); // 输出(宽泛型) // {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Happy"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Work"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Play"}]}]}]} ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-deque.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-deque.md index f484ec6e2ffb746d151014e3620aa2e728f81e4c..a562f3a7118b3754ebd12362484a2c45eea35ea1 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-deque.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-deque.md @@ -295,7 +295,7 @@ deque.insertEnd(4); deque.insertFront(5); deque.insertEnd(4); deque.forEach((value: number, index?: number | undefined, deque?: Deque | undefined):void => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -404,14 +404,14 @@ deque.insertFront(4); // 使用方法一: let nums: Array = Array.from(deque); for (let item of nums) { - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = deque[Symbol.iterator](); let temp:IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-hashmap.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-hashmap.md index 526d7aae58175fb46215054ee6d8d4045d0d0b56..b6c8bfea448153a314eff825ef1b16934600ff0c 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-hashmap.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-hashmap.md @@ -389,7 +389,7 @@ hashMap.set("sparrow", 356); let iter = hashMap.keys(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` @@ -428,7 +428,7 @@ hashMap.set("sparrow", 356); let iter = hashMap.values(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` @@ -514,7 +514,7 @@ let hashMap: HashMap = new HashMap(); hashMap.set("sparrow", 123); hashMap.set("gull", 357); hashMap.forEach((value?: number, key?: string) => { - console.log("value:" + value, "key:" + key); + console.info("value:" + value, "key:" + key); }); ``` ```ts @@ -562,8 +562,8 @@ hashMap.set("sparrow", 356); let iter = hashMap.entries(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` @@ -611,16 +611,16 @@ hashMap.set("sparrow", 356); // 使用方法一: let keys = Array.from(hashMap.keys()); for (let key of keys) { - console.log("key:" + key); - console.log("value:" + hashMap.get(key)); + console.info("key:" + key); + console.info("value:" + hashMap.get(key)); } // 使用方法二: let iter = hashMap[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-hashset.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-hashset.md index 1ba6bfa563e00f428a2fda3f18ff6c4c75bf8b7f..95eb6afb239aef01b3cf8b39f157f8bc36c13542 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-hashset.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-hashset.md @@ -282,7 +282,7 @@ hashSet.add("sparrow"); let iter = hashSet.values(); let temp = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` @@ -328,7 +328,7 @@ let hashSet: HashSet = new HashSet(); hashSet.add("sparrow"); hashSet.add("squirrel"); hashSet.forEach((value?: string, key?: string): void => { - console.log("value:" + value, "key:" + key); + console.info("value:" + value, "key:" + key); }); ``` ```ts @@ -374,8 +374,8 @@ hashSet.add("sparrow"); let iter = hashSet.entries(); let temp: IteratorResult<[string, string]> = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` @@ -424,14 +424,14 @@ hashSet.add("sparrow"); // 使用方法一: let val: Array = Array.from(hashSet.values()); for (let item of val) { - console.log("value: " + item); + console.info("value: " + item); } // 使用方法二: let iter = hashSet[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value: " + temp.value); + console.info("value: " + temp.value); temp = iter.next(); } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightmap.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightmap.md index c77c98d11d5f54d64b079cb86ba479b235e240b7..07da8463e8e17868b3023fbbe2778302edf8bbc5 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightmap.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightmap.md @@ -711,7 +711,7 @@ lightWeightMap.set("sparrow", 356); let iter = lightWeightMap.keys(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` @@ -750,7 +750,7 @@ lightWeightMap.set("sparrow", 356); let iter = lightWeightMap.values(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` @@ -796,7 +796,7 @@ let lightWeightMap: LightWeightMap = new LightWeightMap(); lightWeightMap.set("sparrow", 123); lightWeightMap.set("gull", 357); lightWeightMap.forEach((value?: number, key?: string) => { - console.log("value:" + value, "key:" + key); + console.info("value:" + value, "key:" + key); }); ``` ```ts @@ -843,8 +843,8 @@ lightWeightMap.set("sparrow", 356); let iter = lightWeightMap.entries(); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` @@ -926,20 +926,20 @@ lightWeightMap.set("sparrow", 356); // 使用方法一: let nums = Array.from(lightWeightMap.values()); for (let item1 of nums) { - console.log("value:" + item1); + console.info("value:" + item1); } let key = Array.from(lightWeightMap.keys()); for (let item2 of key) { - console.log("key:" + item2); + console.info("key:" + item2); } // 使用方法二: let iter = lightWeightMap[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightset.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightset.md index 9fdc29a290dda55b70a7f95e2882621923d19b45..82d2e35dcffdb57429f2a8d1f06360b724ada99f 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightset.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-lightweightset.md @@ -573,7 +573,7 @@ lightWeightSet.add("sparrow"); let iter = lightWeightSet.values(); let index = 0; while(index < lightWeightSet.length) { - console.log(JSON.stringify(iter.next().value)); + console.info(JSON.stringify(iter.next().value)); index++; } ``` @@ -619,7 +619,7 @@ let lightWeightSet: LightWeightSet = new LightWeightSet(); lightWeightSet.add("sparrow"); lightWeightSet.add("gull"); lightWeightSet.forEach((value ?: string, key ?: string) => { - console.log("value:" + value, "key:" + key); + console.info("value:" + value, "key:" + key); }); ``` ```ts @@ -666,7 +666,7 @@ lightWeightSet.add("sparrow"); let iter = lightWeightSet.entries(); let index = 0; while(index < lightWeightSet.length) { - console.log(JSON.stringify(iter.next().value)); + console.info(JSON.stringify(iter.next().value)); index++; } ``` @@ -715,14 +715,14 @@ lightWeightSet.add("sparrow"); // 使用方法一: let nums: Array = lightWeightSet.toArray() for (let item of nums) { - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = lightWeightSet[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-linkedlist.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-linkedlist.md index 9cd4e2f4d91332415fd2c9dceb6698d9e01ea4a8..25abd989dfb04fbcc563c02760e143ffe1b92943 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-linkedlist.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-linkedlist.md @@ -684,7 +684,7 @@ linkedList.add(4); linkedList.add(5); linkedList.add(4); linkedList.forEach((value: number, index?: number) => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -901,14 +901,14 @@ linkedList.add(4); // 使用方法一: let items = Array.from(linkedList); for (let item of items) { - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = linkedList[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value:" + temp.value); + console.info("value:" + temp.value); temp = iter.next(); } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-list.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-list.md index 6330d7acef27ec3887e83dbcb6df7a5f0a13019d..4cdc2f88f6a825f700f74e951497dc647efbb0fa 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-list.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-list.md @@ -539,7 +539,7 @@ list.add(4); list.add(5); list.add(4); list.forEach((value: number, index?: number) => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -880,14 +880,14 @@ list.add(4); // 使用方法一: let items = Array.from(list); for (let item of items) { - console.log("value: " + item); + console.info("value: " + item); } // 使用方法二: let iter = list[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("value: " + temp.value); + console.info("value: " + temp.value); temp = iter.next(); } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-plainarray.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-plainarray.md index 7819620a4676833ffed9bc1700b015ed0f118514..af1f5f3138eb7009aaf723e06c2294c6ba54c0b5 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-plainarray.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-plainarray.md @@ -668,7 +668,7 @@ let plainArray: PlainArray = new PlainArray(); plainArray.add(1, "squirrel"); plainArray.add(2, "sparrow"); plainArray.forEach((value: string, index?: number) => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` ```ts @@ -717,8 +717,8 @@ plainArray.add(2, "sparrow"); let iter = plainArray[Symbol.iterator](); let temp: IteratorResult = iter.next(); while(!temp.done) { - console.log("key:" + temp.value[0]); - console.log("value:" + temp.value[1]); + console.info("key:" + temp.value[0]); + console.info("value:" + temp.value[1]); temp = iter.next(); } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-process.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-process.md index 58db3c5c2ce190603852ab0036f77b64d5a0cdaf..95d91198af6da9cf62f8f5f062afea7513812267 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-process.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-process.md @@ -434,7 +434,7 @@ let pro = new process.ProcessManager(); // uid通过process.uid获取 let pres = process.uid; let result = pro.isAppUid(pres); -console.log("result: " + result); // result: true +console.info("result: " + result); // result: true ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-queue.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-queue.md index 6a935c22b1018dc34d44057e7b2280bda68f08ac..8518bcc7600da6f1496c422301d84f77ce2dcb47 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-queue.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-queue.md @@ -220,7 +220,7 @@ queue.add(4); queue.add(5); queue.add(4); queue.forEach((value : number, index ?: number) : void => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -259,14 +259,14 @@ queue.add(4); // 使用方法一: while(queue.length) { let item = queue.pop(); - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = queue[Symbol.iterator](); let temp: IteratorResult = iter.next().value; while(temp != undefined) { - console.log("value:" + temp); + console.info("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-stack.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-stack.md index 5b9bae1fb84065fdd04653f61240cff9d74fcac5..2ea0a016a1c536725cf527d9f5c23e7c3048cc0f 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-stack.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-stack.md @@ -258,7 +258,7 @@ stack.push(4); stack.push(5); stack.push(4); stack.forEach((value : number, index ?: number) :void => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -333,14 +333,14 @@ stack.push(4); while(!stack.isEmpty()) { // 业务逻辑 let item = stack.pop(); - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = stack[Symbol.iterator](); let temp: IteratorResult = iter.next().value; while(temp != undefined) { - console.log("value:" + temp); + console.info("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-treemap.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-treemap.md index 4b959685f3072afbe929da1e26df9fa0f39b665c..15f3992a961a67801ae5b00789bd0367e807899e 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-treemap.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-treemap.md @@ -370,7 +370,7 @@ let map : TreeMap = new TreeMap(); map.set("demo", 12); map.setAll(treeMap); // 将treeMap中的所有元素添加到map中 map.forEach((value ?: number, key ?: string) : void => { - console.log("value: " + value, "key: " + key); + console.info("value: " + value, "key: " + key); }) // 输出结果: // value: 12 key: demo diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-treeset.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-treeset.md index 1cc8ecb4913ebbcfccf6e4758c3facc7ff82d76c..9f81df0b23a68bba6f0eb50bba0acdada4e8bc2d 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-treeset.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-treeset.md @@ -82,7 +82,7 @@ treeSet.add("d"); treeSet.add("b"); let numbers = Array.from(treeSet.values()); for (let item of numbers) { - console.log("TreeSet:" + item); + console.info("TreeSet:" + item); } ``` @@ -100,7 +100,7 @@ let entry2: TestEntry = { } ts1.add(entry1); ts1.add(entry2); -console.log("treeSet: ", ts1.length); +console.info("treeSet: ", ts1.length); ``` @@ -534,7 +534,7 @@ treeSet.add("sparrow"); let it = treeSet.values(); let t: IteratorResult = it.next(); while(!t.done) { - console.log("TreeSet: " + t.value); + console.info("TreeSet: " + t.value); t = it.next() } ``` @@ -580,7 +580,7 @@ let treeSet : TreeSet = new TreeSet(); treeSet.add("sparrow"); treeSet.add("gull"); treeSet.forEach((value ?: string, key ?: string) :void => { - console.log("value:" + value, "key:" + key); + console.info("value:" + value, "key:" + key); }); ``` ```ts @@ -627,7 +627,7 @@ treeSet.add("sparrow"); let it = treeSet.entries(); let t: IteratorResult = it.next(); while(!t.done) { - console.log("TreeSet: " + t.value); + console.info("TreeSet: " + t.value); t = it.next() } ``` @@ -675,13 +675,13 @@ treeSet.add("sparrow"); let numbers = Array.from(treeSet.values()); // 使用方法一: for (let item of numbers) { - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = treeSet[Symbol.iterator](); let temp: IteratorResult = iter.next().value; while(temp != undefined) { - console.log("value:" + temp); + console.info("value:" + temp); temp = iter.next().value; } ``` diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-uri.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-uri.md index 9f741c998a8125723b5faee5dc726e0a0a7715d8..fe0c0dc6fc8cd5871a0acab2803dfa7c1570134d 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-uri.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-uri.md @@ -119,15 +119,15 @@ console.info(uriObj6.encodedAuthority); // username:my+name@host:8080 console.info(uriObj6.encodedSSP); // //username:my+name@host:8080/directory/my+file?foo=1&bar=2 let uriObj7 = new uri.URI("www.abc.com:8080/directory/file?ab=pppppp#qwer=da"); -console.log(uriObj7.scheme); // www.abc.com -console.log(uriObj7.host); // null -console.log(uriObj7.port); // -1 -console.log(uriObj7.path); // null -console.log(uriObj7.query); // null -console.log(uriObj7.authority); // null -console.log(uriObj7.fragment); // qwer=da -console.log(uriObj7.ssp); // 8080/directory/file?ab=pppppp -console.log("result:", uriObj7.checkIsAbsolute()); // result: true +console.info(uriObj7.scheme); // www.abc.com +console.info(uriObj7.host); // null +console.info(uriObj7.port); // -1 +console.info(uriObj7.path); // null +console.info(uriObj7.query); // null +console.info(uriObj7.authority); // null +console.info(uriObj7.fragment); // qwer=da +console.info(uriObj7.ssp); // 8080/directory/file?ab=pppppp +console.info("result:", uriObj7.checkIsAbsolute()); // result: true ``` ### constructor @@ -289,10 +289,10 @@ console.info(uriInstance.path); // /path/path1/../path2/./path3 let uriInstance1 = uriInstance.normalize(); console.info(uriInstance1.path); // /path/path2/path3 let uri1 = new uri.URI('http://www.test.com/../../patch/path1/../path2/path3/./path4/../'); -console.log(uri1.path); // /../../patch/path1/../path2/path3/./path4/../ +console.info(uri1.path); // /../../patch/path1/../path2/path3/./path4/../ // 如果路径规范化后以 ..(双点)段开头,这表明之前没有足够的非 .. 段可以移除,因此路径将以 .. 段开始。 let uri2 = uri1.normalize(); -console.log(uri2.path); // /../../patch/path2/path3 +console.info(uri2.path); // /../../patch/path2/path3 ``` ### checkRelative12+ diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-url.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-url.md index 6f447d5904a1f82bee59f050568c15e65024c743..87e1e077be656845b03ba1950e660e48c67b43c9 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-url.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-url.md @@ -160,7 +160,7 @@ getAll(name: string): string[] let urlObject = url.URL.parseURL('https://developer.exampleUrl/?fod=1&bard=2'); let params = new url.URLParams(urlObject.search.slice(1)); params.append('fod', '3'); // Add a second value for the fod parameter. -console.log(params.getAll('fod').toString()) // Output ["1","3"]. +console.info(params.getAll('fod').toString()) // Output ["1","3"]. ``` @@ -187,7 +187,7 @@ let searchParamsObject = new url.URLParams("keyName1=valueName1&keyName2=valueNa let pair:Iterable = searchParamsObject.entries(); let arrayValue = Array.from(pair); for (let pair of arrayValue) { // Show keyName/valueName pairs - console.log(pair[0]+ ', '+ pair[1]); + console.info(pair[0]+ ', '+ pair[1]); } ``` @@ -230,7 +230,7 @@ forEach(callbackFn: (value: string, key: string, searchParams: URLParams) => voi ```ts const myURLObject = url.URL.parseURL('https://developer.exampleUrl/?fod=1&bard=2'); myURLObject.params.forEach((value, name, searchParams) => { - console.log(name, value, myURLObject.params === searchParams); + console.info(name, value, myURLObject.params === searchParams); }); ``` @@ -370,7 +370,7 @@ sort(): void ```ts let searchParamsObject = new url.URLParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object searchParamsObject.sort(); // Sort the key/value pairs -console.log(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=4&c=3&d=2 +console.info(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=4&c=3&d=2 ``` @@ -396,7 +396,7 @@ keys(): IterableIterator<string> let searchParamsObject = new url.URLParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing let keys = Array.from(searchParamsObject.keys()); for (let key of keys) { // Output key-value pairs - console.log(key); + console.info(key); } ``` @@ -423,7 +423,7 @@ values(): IterableIterator<string> let searchParams = new url.URLParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing let values = Array.from(searchParams.values()); for (let value of values) { - console.log(value); + console.info(value); } ``` @@ -451,7 +451,7 @@ const paramsObject = new url.URLParams('fod=bay&edg=bap'); let iter: Iterable = paramsObject[Symbol.iterator](); let pairs = Array.from(iter); for (let pair of pairs) { - console.log(pair[0] + ', ' + pair[1]); + console.info(pair[0] + ', ' + pair[1]); } ``` @@ -478,7 +478,7 @@ toString(): string let urlObject = url.URL.parseURL('https://developer.exampleUrl/?fod=1&bard=2'); let params = new url.URLParams(urlObject.search.slice(1)); params.append('fod', '3'); -console.log(params.toString()); // Output 'fod=1&bard=2&fod=3' +console.info(params.toString()); // Output 'fod=1&bard=2&fod=3' ``` ## URL @@ -509,19 +509,19 @@ console.log(params.toString()); // Output 'fod=1&bard=2&fod=3' ```ts let that = url.URL.parseURL('http://username:password@host:8080/directory/file?foo=1&bar=2#fragment'); -console.log("hash " + that.hash); // hash #fragment -console.log("host " + that.host); // host host:8080 -console.log("hostname " + that.hostname); // hostname host -console.log("href " + that.href); // href http://username:password@host:8080/directory/file?foo=1&bar=2#fragment -console.log("origin " + that.origin); // origin http://host:8080 -console.log("password " + that.password); // password password -console.log("pathname " + that.pathname); // pathname /directory/file -console.log("port " + that.port); // port 8080 -console.log("protocol " + that.protocol); // protocol http: -console.log("search " + that.search); // search ?foo=1&bar=2 -console.log("username " + that.username); // username username +console.info("hash " + that.hash); // hash #fragment +console.info("host " + that.host); // host host:8080 +console.info("hostname " + that.hostname); // hostname host +console.info("href " + that.href); // href http://username:password@host:8080/directory/file?foo=1&bar=2#fragment +console.info("origin " + that.origin); // origin http://host:8080 +console.info("password " + that.password); // password password +console.info("pathname " + that.pathname); // pathname /directory/file +console.info("port " + that.port); // port 8080 +console.info("protocol " + that.protocol); // protocol http: +console.info("search " + that.search); // search ?foo=1&bar=2 +console.info("username " + that.username); // username username // that.params 返回值为URLParams对象 -console.log("params: foo " + that.params.get("foo")); // params: foo 1 +console.info("params: foo " + that.params.get("foo")); // params: foo 1 ``` ### constructor(deprecated) @@ -783,7 +783,7 @@ getAll(name: string): string[] let urlObject = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); let params = new url.URLSearchParams(urlObject.search.slice(1)); params.append('fod', '3'); // Add a second value for the fod parameter. -console.log(params.getAll('fod').toString()) // Output ["1","3"]. +console.info(params.getAll('fod').toString()) // Output ["1","3"]. ``` ### entries(deprecated) @@ -811,7 +811,7 @@ let searchParamsObject = new url.URLSearchParams("keyName1=valueName1&keyName2=v let iter: Iterable = searchParamsObject.entries(); let pairs = Array.from(iter); for (let pair of pairs) { // Show keyName/valueName pairs - console.log(pair[0]+ ', '+ pair[1]); + console.info(pair[0]+ ', '+ pair[1]); } ``` @@ -848,7 +848,7 @@ forEach(callbackFn: (value: string, key: string, searchParams: URLSearchParams) ```ts const myURLObject = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); myURLObject.searchParams.forEach((value, name, searchParams) => { - console.log(name, value, myURLObject.searchParams === searchParams); + console.info(name, value, myURLObject.searchParams === searchParams); }); ``` @@ -967,7 +967,7 @@ sort(): void ```ts let searchParamsObject = new url.URLSearchParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object searchParamsObject.sort(); // Sort the key/value pairs -console.log(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=4&c=3&d=2 +console.info(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=4&c=3&d=2 ``` @@ -995,7 +995,7 @@ keys(): IterableIterator<string> let searchParamsObject = new url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing let keys = Array.from(searchParamsObject.keys()); for (let key of keys) { // Output key-value pairs - console.log(key); + console.info(key); } ``` @@ -1024,7 +1024,7 @@ values(): IterableIterator<string> let searchParams = new url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing let values = Array.from(searchParams.values()); for (let value of values) { - console.log(value); + console.info(value); } ``` @@ -1054,7 +1054,7 @@ const paramsObject = new url.URLSearchParams('fod=bay&edg=bap'); let iter: Iterable = paramsObject[Symbol.iterator](); let pairs = Array.from(iter); for (let pair of pairs) { - console.log(pair[0] + ', ' + pair[1]); + console.info(pair[0] + ', ' + pair[1]); } ``` @@ -1082,6 +1082,6 @@ toString(): string let urlObject = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); let params = new url.URLSearchParams(urlObject.search.slice(1)); params.append('fod', '3'); -console.log(params.toString()); // Output 'fod=1&bard=2&fod=3' +console.info(params.toString()); // Output 'fod=1&bard=2&fod=3' ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-vector.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-vector.md index 9974a935a91cfebdb27e3cb768f0effcbf595a37..92555c95ed140af71337b6c1e2dbf0818ed1d146 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-vector.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-vector.md @@ -365,7 +365,7 @@ vector.add(4); vector.add(5); vector.add(4); vector.forEach((value : number, index ?: number) : void => { - console.log("value:" + value, "index:" + index); + console.info("value:" + value, "index:" + index); }); ``` @@ -858,14 +858,14 @@ vector.add(4); // 使用方法一: let nums: Array = vector.convertToArray() for (let item of nums) { - console.log("value:" + item); + console.info("value:" + item); } // 使用方法二: let iter = vector[Symbol.iterator](); let temp: IteratorResult = iter.next().value; while(temp != undefined) { - console.log("value:" + temp); + console.info("value:" + temp); temp = iter.next().value; } ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis-arkts/js-apis-xml.md b/zh-cn/application-dev/reference/apis-arkts/js-apis-xml.md index a9f8e65161f04f939a753cd883953bbaa69dfe9f..42e6d4df9ab55e668e87e0f3a4e0f7f01f7f34b6 100644 --- a/zh-cn/application-dev/reference/apis-arkts/js-apis-xml.md +++ b/zh-cn/application-dev/reference/apis-arkts/js-apis-xml.md @@ -98,7 +98,7 @@ thatSer.setAttributes("importance", "high"); thatSer.endElement(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // +console.info(result); // ``` ### addEmptyElement @@ -139,7 +139,7 @@ let thatSer = new xml.XmlSerializer(arrayBuffer); thatSer.addEmptyElement("d"); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // +console.info(result); // ``` ### setDeclaration @@ -162,7 +162,7 @@ let thatSer = new xml.XmlSerializer(arrayBuffer); thatSer.setDeclaration(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); +console.info(result); // ``` @@ -208,7 +208,7 @@ thatSer.setText("Happy"); thatSer.endElement(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); +console.info(result); // Happy ``` @@ -238,7 +238,7 @@ thatSer.setText("Happy"); thatSer.endElement(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); +console.info(result); // Happy ``` @@ -283,7 +283,7 @@ thatSer.startElement("note"); thatSer.endElement(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); +console.info(result); // ``` @@ -321,7 +321,7 @@ let thatSer = new xml.XmlSerializer(arrayBuffer); thatSer.setComment("Hello, World!"); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // +console.info(result); // ``` ### setCDATA @@ -362,7 +362,7 @@ let thatSer = new xml.XmlSerializer(arrayBuffer); thatSer.setCDATA('root SYSTEM') let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // +console.info(result); // ``` ### setText @@ -402,7 +402,7 @@ thatSer.setText("Happy"); thatSer.endElement(); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // Happy +console.info(result); // Happy ``` ### setDocType @@ -439,7 +439,7 @@ let thatSer = new xml.XmlSerializer(arrayBuffer); thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"'); let uint8 = new Uint8Array(arrayBuffer); let result = util.TextDecoder.create().decodeToString(uint8); -console.log(result); // +console.info(result); // ``` ## XmlDynamicSerializer20+ @@ -999,7 +999,7 @@ let uint8 = textEncoder.encodeInto(strxml); function func(key: xml.EventType, value: xml.ParseInfo) { if (key == xml.EventType.CDSECT) { - console.log(JSON.stringify(value.getText())); + console.info(JSON.stringify(value.getText())); } return true; } @@ -1054,7 +1054,7 @@ let that = new xml.XmlPullParser(arrbuffer.buffer as object as ArrayBuffer, 'UTF let str = ''; function func(name: string, value: string) { str = name + value; - console.log(str); + console.info(str); return true; } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tagValueCallbackFunction:func} @@ -1123,7 +1123,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:1 key:2 value:45 key:4 value:50 key:3 value:57 key:1 value:57 ``` @@ -1167,7 +1167,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:0 key:2 value:1 key:2 value:2 key:4 value:2 key:3 value:2 key:3 value:1 key:1 value:0 ``` @@ -1203,7 +1203,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:1 key:2 value:1 key:4 value:1 key:3 value:1 key:1 value:1 ``` @@ -1239,7 +1239,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value: key:2 value:note key:4 value: key:3 value:note key:1 value: ``` ### getNamespace @@ -1278,7 +1278,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:false, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value: key:2 value: key:2 value:http://www.w3.org key:4 value: key:3 value:http://www.w3.org key:3 value: key:1 value: ``` ### getPrefix @@ -1317,7 +1317,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:false, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value: key:2 value: key:2 value:h key:4 value: key:3 value:h key:3 value: key:1 value: ``` @@ -1353,7 +1353,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value: key:2 value: key:4 value:Happy key:3 value: key:1 value: ``` ### isEmptyElementTag @@ -1392,7 +1392,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:false key:2 value:false key:2 value:true key:3 value:false key:3 value:false key:1 value:false ``` ### isWhitespace @@ -1431,7 +1431,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:true key:2 value:false key:2 value:true key:10 value:true key:3 value:true key:3 value:true key:1 value:true ``` ### getAttributeCount @@ -1465,7 +1465,7 @@ function func(key: xml.EventType, value: xml.ParseInfo) { } let options: xml.ParseOptions = {supportDoctype:true, ignoreNameSpace:true, tokenValueCallbackFunction:func} that.parse(options); -console.log(str); +console.info(str); // key:0 value:0 key:2 value:2 key:3 value:2 key:1 value:0 ```