array 数组
sum 数组求和
ts
import { sum } from 'fe-toolsbox'
const array = [1, 2, 3, 4, 5]
sum(array)
15
average 数组求平均数
ts
import { average } from 'fe-toolsbox'
const array = [1, 2, 3, 4, 5]
average(array)
3
uniq 数组去重
ts
import { uniq } from 'fe-toolsbox'
const array = [1, 2, 2, 3, 3, 4, 5]
uniq(array)
[
1,
2,
3,
4,
5
]