Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a43a20a7
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a43a20a7
编写于
5月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3901 Solve the problem of console Log error
Merge pull request !3901 from wangyong/release_three
上级
aa75edab
c2674c19
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
87 addition
and
87 deletion
+87
-87
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-deque.md
zh-cn/application-dev/reference/apis/js-apis-deque.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
+10
-10
zh-cn/application-dev/reference/apis/js-apis-hashset.md
zh-cn/application-dev/reference/apis/js-apis-hashset.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
.../application-dev/reference/apis/js-apis-lightweightmap.md
+10
-10
zh-cn/application-dev/reference/apis/js-apis-lightweightset.md
.../application-dev/reference/apis/js-apis-lightweightset.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-list.md
zh-cn/application-dev/reference/apis/js-apis-list.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
+7
-7
zh-cn/application-dev/reference/apis/js-apis-queue.md
zh-cn/application-dev/reference/apis/js-apis-queue.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-stack.md
zh-cn/application-dev/reference/apis/js-apis-stack.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-treemap.md
zh-cn/application-dev/reference/apis/js-apis-treemap.md
+10
-10
zh-cn/application-dev/reference/apis/js-apis-treeset.md
zh-cn/application-dev/reference/apis/js-apis-treeset.md
+7
-7
zh-cn/application-dev/reference/apis/js-apis-vector.md
zh-cn/application-dev/reference/apis/js-apis-vector.md
+6
-6
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-deque.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-hashset.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-lightweightset.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-list.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-queue.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-stack.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-treemap.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-treeset.md
浏览文件 @
a43a20a7
...
...
@@ -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
zh-cn/application-dev/reference/apis/js-apis-vector.md
浏览文件 @
a43a20a7
...
...
@@ -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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录