- Preparing search index...
- The search index is not available
yatter
- sorter<T>(calKey: ((ele: T) => (string | number)[]), order?: OneOrMore<OrderType>): ((a: T, b: T) => 0 | 1 | -1)
-
Parameters
-
calKey: ((ele: T) => (string | number)[])
-
- (ele: T): (string | number)[]
-
Returns (string | number)[]
-
order: OneOrMore<OrderType> = 'asc'
Returns ((a: T, b: T) => 0 | 1 | -1)
-
- (a: T, b: T): 0 | 1 | -1
-
Returns 0 | 1 | -1
为数组 sort 方法生成排序函数, 根据根据参数一函数返回的数组依次排序
Returns
排序函数
Example