ZGG内置类型-数组
数组的声明与访问
[item0, item1, ...]arr[index]数组的运算
加法
zgg> [1, 2, 3] + [4, 5, 6] + [7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9]乘法
zgg> [1, 2, 3] * 3
[1, 2, 3, 1, 2, 3, 1, 2, 3]
zgg> [1, 2, 3] * 0
[]数组推导式
数组的内置方法
方法名
作用
生成数组的内建函数
函数名
作用
函数详解
Array.map(mapper)
mapper类型
映射结果
Examples:
Array.filter(filterFunc)
Examples:
Array.reduce(reducer, initialValue?)
Examples:
Array.each(callback)
Array.toMap(keyMapper?, valueMapper?)
Examples:
Array.toGroup(keyMapper?, valueMapper?)
Examples:
Array.chunk(chunkSize)
Examples:
Array.find(predict)
Examples:
Array.findIndex(predict)
Examples:
func seq(a, b)
func range(end)
Example:
func range(begin, end)
Example:
func range(begin, end, step)
Example:
最后更新于