Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
4c744d18
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看板
未验证
提交
4c744d18
编写于
9月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23626 docs arkts整改
Merge pull request !23626 from coollixin/master
上级
165494a0
a89d83c2
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
62 addition
and
62 deletion
+62
-62
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-buffer.md
zh-cn/application-dev/reference/apis/js-apis-buffer.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-deque.md
zh-cn/application-dev/reference/apis/js-apis-deque.md
+7
-7
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
+8
-8
zh-cn/application-dev/reference/apis/js-apis-hashset.md
zh-cn/application-dev/reference/apis/js-apis-hashset.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
.../application-dev/reference/apis/js-apis-lightweightmap.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-lightweightset.md
.../application-dev/reference/apis/js-apis-lightweightset.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-list.md
zh-cn/application-dev/reference/apis/js-apis-list.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-queue.md
zh-cn/application-dev/reference/apis/js-apis-queue.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-stack.md
zh-cn/application-dev/reference/apis/js-apis-stack.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-treemap.md
zh-cn/application-dev/reference/apis/js-apis-treemap.md
+11
-11
zh-cn/application-dev/reference/apis/js-apis-treeset.md
zh-cn/application-dev/reference/apis/js-apis-treeset.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-vector.md
zh-cn/application-dev/reference/apis/js-apis-vector.md
+4
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-arraylist.md
浏览文件 @
4c744d18
...
...
@@ -456,7 +456,7 @@ arrayList.add(2);
arrayList
.
add
(
4
);
arrayList
.
add
(
5
);
arrayList
.
add
(
4
);
arrayList
.
forEach
((
value
:
number
,
index
:
number
)
=>
{
arrayList
.
forEach
((
value
:
number
,
index
?
:
number
)
=>
{
console
.
log
(
"
hyq value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-buffer.md
浏览文件 @
4c744d18
...
...
@@ -634,9 +634,9 @@ import buffer from '@ohos.buffer';
let
buf
=
buffer
.
from
(
'
buffer
'
);
let
pair
=
buf
.
entries
()
let
next
=
pair
.
next
()
let
next
:
IteratorResult
<
Object
[]
>
=
pair
.
next
()
while
(
!
next
.
done
)
{
console
.
info
(
next
.
value
)
console
.
info
(
"
buffer:
"
+
next
.
value
)
next
=
pair
.
next
()
}
```
...
...
@@ -1963,7 +1963,7 @@ import buffer from '@ohos.buffer';
let
buf1
=
buffer
.
from
(
'
buffer
'
);
let
pair
=
buf1
.
values
()
let
next
=
pair
.
next
()
let
next
:
IteratorResult
<
number
>
=
pair
.
next
()
while
(
!
next
.
done
)
{
console
.
log
(
next
.
value
.
toString
());
next
=
pair
.
next
()
...
...
@@ -2923,8 +2923,8 @@ import buffer from '@ohos.buffer';
let
blob
:
buffer
.
Blob
=
new
buffer
.
Blob
([
'
a
'
,
'
b
'
,
'
c
'
]);
class
option
{
endings
:
string
type
:
string
endings
:
string
=
""
type
:
string
=
""
}
let
o1
:
option
=
{
endings
:
'
native
'
,
type
:
'
MIME
'
}
let
blob1
:
buffer
.
Blob
=
new
buffer
.
Blob
([
'
a
'
,
'
b
'
,
'
c
'
],
o1
);
...
...
zh-cn/application-dev/reference/apis/js-apis-deque.md
浏览文件 @
4c744d18
...
...
@@ -119,8 +119,8 @@ insertEnd(element: T): void
```
ts
class
C1
{
name
:
string
age
:
string
name
:
string
=
""
age
:
string
=
""
}
let
deque
:
Deque
<
string
|
number
|
boolean
|
Array
<
number
>
|
C1
>
=
new
Deque
();
...
...
@@ -277,7 +277,7 @@ deque.insertFront(2);
deque
.
insertEnd
(
4
);
deque
.
insertFront
(
5
);
deque
.
insertEnd
(
4
);
deque
.
forEach
((
value
:
number
,
index
:
number
)
=>
{
deque
.
forEach
((
value
:
number
,
index
?:
number
|
undefined
,
deque
?:
Deque
<
number
>
|
undefined
):
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -386,9 +386,9 @@ for (let item of nums) {
// 使用方法二:
let
iter
=
deque
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
temp
=
iter
.
next
()
.
value
;
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
()
;
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
}
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-hashmap.md
浏览文件 @
4c744d18
...
...
@@ -363,7 +363,7 @@ let hashMap: HashMap<string, number> = new HashMap();
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
hashMap
.
keys
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
string
,
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
@@ -400,7 +400,7 @@ let hashMap: HashMap<string, number> = new HashMap();
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
hashMap
.
values
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
@@ -482,7 +482,7 @@ callbackfn的参数说明:
let
hashMap
:
HashMap
<
string
,
number
>
=
new
HashMap
();
hashMap
.
set
(
"
sparrow
"
,
123
);
hashMap
.
set
(
"
gull
"
,
357
);
hashMap
.
forEach
((
value
:
number
,
key
:
string
)
=>
{
hashMap
.
forEach
((
value
?:
number
,
key
?
:
string
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -517,7 +517,7 @@ let hashMap: HashMap<string, number> = new HashMap();
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
hashMap
.
entries
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
key:
"
+
temp
.
value
[
0
]);
console
.
log
(
"
value:
"
+
temp
.
value
[
1
]);
...
...
@@ -555,14 +555,14 @@ hashMap.set("squirrel", 123);
hashMap
.
set
(
"
sparrow
"
,
356
);
// 使用方法一:
for
(
let
item
of
hashMap
)
{
console
.
log
(
"
key:
"
+
item
[
0
]
);
console
.
log
(
"
value:
"
+
item
[
1
]
);
for
(
let
key
of
keys
)
{
console
.
log
(
"
key:
"
+
key
);
console
.
log
(
"
value:
"
+
hashMap
.
get
(
key
)
);
}
// 使用方法二:
let
iter
=
hashMap
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
key:
"
+
temp
[
0
]);
console
.
log
(
"
value:
"
+
temp
[
1
]);
...
...
zh-cn/application-dev/reference/apis/js-apis-hashset.md
浏览文件 @
4c744d18
...
...
@@ -305,7 +305,7 @@ callbackfn的参数说明:
let
hashSet
:
HashSet
<
string
>
=
new
HashSet
();
hashSet
.
add
(
"
sparrow
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
forEach
((
value
:
string
,
key
:
string
)
=>
{
hashSet
.
forEach
((
value
?:
string
,
key
?:
string
):
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -339,7 +339,7 @@ let hashSet: HashSet<string> = new HashSet();
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
sparrow
"
);
let
iter
=
hashSet
.
entries
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
string
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
key:
"
+
temp
.
value
[
0
]);
console
.
log
(
"
value:
"
+
temp
.
value
[
1
]);
...
...
@@ -385,7 +385,7 @@ for (let item of val) {
// 使用方法二:
let
iter
=
hashSet
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
string
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
浏览文件 @
4c744d18
...
...
@@ -666,7 +666,7 @@ let lightWeightMap: LightWeightMap<string, number> = new LightWeightMap();
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
lightWeightMap
.
keys
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
string
,
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
@@ -703,7 +703,7 @@ let lightWeightMap: LightWeightMap<string, number> = new LightWeightMap();
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
lightWeightMap
.
values
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
@@ -747,7 +747,7 @@ callbackfn的参数说明:
let
lightWeightMap
:
LightWeightMap
<
string
,
number
>
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
sparrow
"
,
123
);
lightWeightMap
.
set
(
"
gull
"
,
357
);
lightWeightMap
.
forEach
((
value
:
number
,
key
:
string
)
=>
{
lightWeightMap
.
forEach
((
value
?:
number
,
key
?
:
string
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -782,7 +782,7 @@ let lightWeightMap: LightWeightMap<string, number> = new LightWeightMap();
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
sparrow
"
,
356
);
let
iter
=
lightWeightMap
.
entries
();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
key:
"
+
temp
.
value
[
0
]);
console
.
log
(
"
value:
"
+
temp
.
value
[
1
]);
...
...
@@ -863,7 +863,7 @@ for (let item2 of key) {
// 使用方法二:
let
iter
=
lightWeightMap
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
key:
"
+
temp
.
value
[
0
]);
console
.
log
(
"
value:
"
+
temp
.
value
[
1
]);
...
...
zh-cn/application-dev/reference/apis/js-apis-lightweightset.md
浏览文件 @
4c744d18
...
...
@@ -611,7 +611,7 @@ callbackfn的参数说明:
let
lightWeightSet
:
LightWeightSet
<
string
>
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
sparrow
"
);
lightWeightSet
.
add
(
"
gull
"
);
lightWeightSet
.
forEach
((
value
:
string
,
key
:
string
)
=>
{
lightWeightSet
.
forEach
((
value
?:
string
,
key
?:
string
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -691,7 +691,7 @@ for (let item of nums) {
// 使用方法二:
let
iter
=
lightWeightSet
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
string
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
zh-cn/application-dev/reference/apis/js-apis-linkedlist.md
浏览文件 @
4c744d18
...
...
@@ -641,7 +641,7 @@ linkedList.add(2);
linkedList
.
add
(
4
);
linkedList
.
add
(
5
);
linkedList
.
add
(
4
);
linkedList
.
forEach
((
value
:
number
,
index
:
number
)
=>
{
linkedList
.
forEach
((
value
:
number
,
index
?
:
number
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -851,7 +851,7 @@ for (let item of items) {
// 使用方法二:
let
iter
=
linkedList
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
zh-cn/application-dev/reference/apis/js-apis-list.md
浏览文件 @
4c744d18
...
...
@@ -503,7 +503,7 @@ list.add(2);
list
.
add
(
4
);
list
.
add
(
5
);
list
.
add
(
4
);
list
.
forEach
((
value
:
number
,
index
:
number
)
=>
{
list
.
forEach
((
value
:
number
,
index
?:
number
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -829,7 +829,7 @@ for (let item of items) {
// 使用方法二:
let
iter
=
list
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
value:
"
+
temp
.
value
);
temp
=
iter
.
next
();
...
...
zh-cn/application-dev/reference/apis/js-apis-plainarray.md
浏览文件 @
4c744d18
...
...
@@ -620,7 +620,7 @@ callbackfn的参数说明:
let
plainArray
:
PlainArray
<
string
>
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
squirrel
"
);
plainArray
.
add
(
2
,
"
sparrow
"
);
plainArray
.
forEach
((
value
:
string
,
index
:
number
)
=>
{
plainArray
.
forEach
((
value
:
string
,
index
?
:
number
)
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -656,7 +656,7 @@ plainArray.add(1, "squirrel");
plainArray
.
add
(
2
,
"
sparrow
"
);
let
iter
=
plainArray
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
();
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
();
while
(
!
temp
.
done
)
{
console
.
log
(
"
key:
"
+
temp
.
value
[
0
]);
console
.
log
(
"
value:
"
+
temp
.
value
[
1
]);
...
...
zh-cn/application-dev/reference/apis/js-apis-queue.md
浏览文件 @
4c744d18
...
...
@@ -206,7 +206,7 @@ queue.add(2);
queue
.
add
(
4
);
queue
.
add
(
5
);
queue
.
add
(
4
);
queue
.
forEach
((
value
:
number
,
index
:
number
)
:
void
=>
{
queue
.
forEach
((
value
:
number
,
index
?
:
number
)
:
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -249,7 +249,7 @@ while(queue.length) {
// 使用方法二:
let
iter
=
queue
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
temp
=
iter
.
next
().
value
;
...
...
zh-cn/application-dev/reference/apis/js-apis-stack.md
浏览文件 @
4c744d18
...
...
@@ -244,7 +244,7 @@ stack.push(2);
stack
.
push
(
4
);
stack
.
push
(
5
);
stack
.
push
(
4
);
stack
.
forEach
((
value
:
number
,
index
:
number
)
:
void
=>
{
stack
.
forEach
((
value
:
number
,
index
?
:
number
)
:
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -321,7 +321,7 @@ while(!stack.isEmpty()) {
// 使用方法二:
let
iter
=
stack
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
temp
=
iter
.
next
().
value
;
...
...
zh-cn/application-dev/reference/apis/js-apis-treemap.md
浏览文件 @
4c744d18
...
...
@@ -302,7 +302,7 @@ treeMap.set("sparrow", 356);
let
map
:
TreeMap
<
string
,
number
>
=
new
TreeMap
();
map
.
set
(
"
demo
"
,
12
);
map
.
setAll
(
treeMap
);
// 将treeMap中的所有元素添加到map中
map
.
forEach
((
value
:
number
,
key
:
string
)
:
void
=>
{
map
.
forEach
((
value
?:
number
,
key
?
:
string
)
:
void
=>
{
console
.
log
(
"
value
"
+
value
,
"
key
"
+
key
);
// 打印结果 12 demo、356 sparrow、123 squirrel
})
```
...
...
@@ -553,9 +553,9 @@ let treeMap : TreeMap<string, number> = new TreeMap();
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
sparrow
"
,
356
);
let
it
=
treeMap
.
values
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
number
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeMap
"
+
t
.
value
);
t
=
it
.
next
()
}
```
...
...
@@ -590,9 +590,9 @@ let treeMap : TreeMap<string, number> = new TreeMap();
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
sparrow
"
,
356
);
let
it
=
treeMap
.
values
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
number
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeMap
"
+
t
.
value
);
t
=
it
.
next
()
}
```
...
...
@@ -634,7 +634,7 @@ callbackFn的参数说明:
let
treeMap
:
TreeMap
<
string
,
number
>
=
new
TreeMap
();
treeMap
.
set
(
"
sparrow
"
,
123
);
treeMap
.
set
(
"
gull
"
,
357
);
treeMap
.
forEach
((
value
:
number
,
key
:
string
)
:
void
=>
{
treeMap
.
forEach
((
value
?:
number
,
key
?
:
string
)
:
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -669,9 +669,9 @@ let treeMap : TreeMap<string, number> = new TreeMap();
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
sparrow
"
,
356
);
let
it
=
treeMap
.
entries
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
Object
[]
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeMap
"
+
t
.
value
);
t
=
it
.
next
()
}
```
...
...
@@ -707,14 +707,14 @@ treeMap.set("sparrow", 356);
// 使用方法一:
let
it
=
treeMap
.
entries
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
Object
[]
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeMap
"
+
t
.
value
);
t
=
it
.
next
()
// 使用方法二:
let
iter
=
treeMap
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
Object
[]
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
key:
"
+
temp
[
0
]);
console
.
log
(
"
value:
"
+
temp
[
1
]);
...
...
zh-cn/application-dev/reference/apis/js-apis-treeset.md
浏览文件 @
4c744d18
...
...
@@ -462,9 +462,9 @@ let treeSet : TreeSet<string> = new TreeSet();
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
sparrow
"
);
let
it
=
treeSet
.
values
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
string
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeSet:
"
+
t
.
value
);
t
=
it
.
next
()
}
```
...
...
@@ -506,7 +506,7 @@ callbackFn的参数说明:
let
treeSet
:
TreeSet
<
string
>
=
new
TreeSet
();
treeSet
.
add
(
"
sparrow
"
);
treeSet
.
add
(
"
gull
"
);
treeSet
.
forEach
((
value
:
string
,
key
:
string
)
:
void
=>
{
treeSet
.
forEach
((
value
?:
string
,
key
?
:
string
)
:
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
key:
"
+
key
);
});
```
...
...
@@ -541,9 +541,9 @@ let treeSet : TreeSet<string> = new TreeSet();
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
sparrow
"
);
let
it
=
treeSet
.
entries
();
let
t
=
it
.
next
();
let
t
:
IteratorResult
<
Object
[]
>
=
it
.
next
();
while
(
!
t
.
done
)
{
console
.
log
(
t
.
value
);
console
.
log
(
"
TreeSet:
"
+
t
.
value
);
t
=
it
.
next
()
}
```
...
...
@@ -585,7 +585,7 @@ for (let item of numbers) {
}
// 使用方法二:
let
iter
=
treeSet
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
string
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
temp
=
iter
.
next
().
value
;
...
...
zh-cn/application-dev/reference/apis/js-apis-vector.md
浏览文件 @
4c744d18
...
...
@@ -44,7 +44,7 @@ Vector的构造函数。
**示例:**
```
ts
let
vector
:
Vector
<
string
|
number
|
C1
|
Array
<
number
>>
=
new
Vector
();
let
vector
:
Vector
<
string
|
number
|
Array
<
number
>>
=
new
Vector
();
```
...
...
@@ -359,12 +359,12 @@ callbackfn的参数说明:
**示例:**
```
ts
let
vector
:
Vector
<
string
|
number
|
Object
|
Array
<
number
>
>
=
new
Vector
();
let
vector
:
Vector
<
number
>
=
new
Vector
();
vector
.
add
(
2
);
vector
.
add
(
4
);
vector
.
add
(
5
);
vector
.
add
(
4
);
vector
.
forEach
((
value
:
Vector
<
string
|
number
|
Object
|
Array
<
number
>>
,
index
:
number
)
:
void
=>
{
vector
.
forEach
((
value
:
number
,
index
?
:
number
)
:
void
=>
{
console
.
log
(
"
value:
"
+
value
,
"
index:
"
+
index
);
});
```
...
...
@@ -864,7 +864,7 @@ for (let item of nums) {
// 使用方法二:
let
iter
=
vector
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
let
temp
:
IteratorResult
<
number
>
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
temp
=
iter
.
next
().
value
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录