f-collection Class
集合功能片段
Methods
indexOf
(
Int
-
item
获取指定子项的索引号(与数组同名方法相同)
Parameters:
-
item
Any子项
Returns:
Int:
索引号, -1表示不存在
lastIndexOf
(
Int
-
item
从后向前获取指定子项的索引号(与数组同名方法相同)
Parameters:
-
item
Any子项
Returns:
Int:
索引号, -1表示不存在
pop
()
Any
弹出最后一个子项(与数组同名方法相同)
Returns:
Any:
弹出的子项
push
(
Int
-
item
在集合的末尾添加一个或多个子项(与数组同名方法相同)
Parameters:
-
item
...子项
Returns:
Int:
子项总数量
shift
()
Any
弹出第一个子项(与数组同名方法相同)
Returns:
Any:
弹出的子项
splice
(
Object[]
-
index
-
length
-
item
在集合的指定位置移除或插入一个或多个子项(与数组同名方法相同)
Parameters:
-
index
Int索引号
-
length
Int=要移除的子项数量
-
item
...=要插入的子项
Returns:
Object[]:
移除的子项集合
unshift
(
Int
-
item
在集合的开始位置插入一个或多个子项(与数组同名方法相同)
Parameters:
-
item
...any子项
Returns:
Int:
子项总数量
Properties
length
Int
子项总数量